Opened 10 years ago

Closed 10 years ago

#6910 closed Bugs (fixed)

[Fusion] Add tr1_result_of specialization

Reported by: Michel Morin Owned by: Joel de Guzman
Milestone: To Be Determined Component: fusion
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

To make result_of and tr1_result_of equivalent, we have to add specialization of tr1_result_of. (Boost.Fusion already has specialization of result_of.)

Also, it would be nice to avoid specialization of result_of, when we use decltype-based result_of. (As for tr1_result_of, it should be specialized even when decltype-based result_of is used.)

So, instead of

template <...>
struct result_of<F()>
{
    typedef XXXX type;
};

we should write

#if !defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_NO_DECLTYPE)
template <...>
struct result_of<F()>
{
    typedef XXXX type;
};
#endif

template <...>
struct tr1_result_of<F()>
{
    typedef XXXX type;
};

A quick grep said the following files specialize result_of.

  • fusion/functional/adapter/unfused.hpp
  • fusion/functional/adapter/unfused_typed.hpp

Attachments (1)

fusion_tr1_result_of.patch (2.1 KB ) - added by Michel Morin 10 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by Joel de Guzman, 10 years ago

If you can prepare a patch, I'd be willing to apply it.

by Michel Morin, 10 years ago

Attachment: fusion_tr1_result_of.patch added

comment:2 by Michel Morin, 10 years ago

Patch attached.

comment:3 by Joel de Guzman, 10 years ago

Resolution: fixed
Status: newclosed

patch applied.

Note: See TracTickets for help on using tickets.