Opened 10 years ago

#7633 new Bugs

Wanted: a way to force a nested result_type

Reported by: Dave Abrahams Owned by: Thomas Heller
Milestone: To Be Determined Component: phoenix
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:

Description

For example, I had to use this:

template <class F> struct void_function : F
{
    typedef void result_type;
    void_function(F x) : F(x) {}
};

template <class F>
void_function<F> make_void(F x)
{
    return void_function<F>(x);
}

in order to get the following to work:

inline std::ostream& operator<<(std::ostream& s, my_variant const& x)
{
    using namespace boost::phoenix::placeholders;
    using namespace boost::phoenix;
    
    boost::apply_visitor( make_void(s << arg1), x );
    //                    ^^^^^^^^^ HERE
    return s;
}

Some libraries, like Boost.Variant, don't follow the result_of protocol.

Change History (0)

Note: See TracTickets for help on using tickets.