[Boost-bugs] [Boost C++ Libraries] #1396: wrong result_of invocation around transform_view

Subject: [Boost-bugs] [Boost C++ Libraries] #1396: wrong result_of invocation around transform_view
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-10-31 22:49:38


#1396: wrong result_of invocation around transform_view
---------------------------------------------------+------------------------
 Reporter: Shunsuke Sogame <pstade.mb_at_[hidden]> | Owner: djowel
     Type: Bugs | Status: new
Milestone: Boost 1.35.0 | Component: fusion
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
---------------------------------------------------+------------------------
 See the following snippet.
 For some reason, `boost::result_of< ::identity(int) >` is invoked in
 `as_vector`,
 which means that the argument is rvalue.
 It should be `boost::result_of< ::identity(int &) >`.

 {{{
 #include <boost/fusion/include/as_vector.hpp>
 #include <boost/fusion/include/transform_view.hpp>
 #include <boost/fusion/include/vector.hpp>


 struct identity
 {
     template<class FunCall>
     struct result;

     template<class Fun>
     struct result<Fun(int&)>
     {
         typedef int& type;
     };

     int& operator()(int& i) const
     {
         return i;
     }
 };


 int main()
 {
     typedef boost::fusion::vector<int, int> from_t;
     from_t from;
     boost::fusion::transform_view<from_t, ::identity> v(from,
 ::identity());

     boost::fusion::as_vector(v); // doesn't compile.
 }
 }}}

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1396>
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:49:56 UTC