[Boost-bugs] [Boost C++ Libraries] #7633: Wanted: a way to force a nested result_type

Subject: [Boost-bugs] [Boost C++ Libraries] #7633: Wanted: a way to force a nested result_type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-11-02 23:53:36


#7633: Wanted: a way to force a nested result_type
------------------------------+---------------------------------------------
 Reporter: dave | Owner: theller
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: phoenix
  Version: Boost 1.52.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 For example, I had to use this:

 {{{#!c++
 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:

 {{{#!c++
 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.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7633>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC