[Boost-bugs] [Boost C++ Libraries] #9631: function_input_iterator does not work with lambda

Subject: [Boost-bugs] [Boost C++ Libraries] #9631: function_input_iterator does not work with lambda
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-02-05 11:04:50


#9631: function_input_iterator does not work with lambda
-------------------------------------+------------------------------
 Reporter: Piotr Wygocki <wygos@…> | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.54.0
 Severity: Problem | Keywords:
-------------------------------------+------------------------------
 The following program does not compile on g++-4.8.1/clang-3.4

   1 #define BOOST_RESULT_OF_USE_DECLTYPE
   2 #include <boost/iterator/function_input_iterator.hpp>
   3
   4 int main() {
   5 auto f = [](){return 1;};
   6 auto i = boost::make_function_input_iterator(f, 0);
   7 return 0;
   8 }

 error:
 g++ main.cpp -std=c++0x -I/home/wygos/libs/boost_1_55_0/include/

     In file included from main.cpp:2:0:
 /home/wygos/libs/boost_1_55_0/include/boost/iterator/function_input_iterator.hpp:
 In instantiation of ‘class
 boost::impl::function_input_iterator<main()::__lambda0, int>’:
 /home/wygos/libs/boost_1_55_0/include/boost/iterator/function_input_iterator.hpp:112:11:
 required from ‘class boost::function_input_iterator<main()::__lambda0,
 int>’
 main.cpp:6:54: required from here
 /home/wygos/libs/boost_1_55_0/include/boost/iterator/function_input_iterator.hpp:26:15:
 error: no type named ‘result_type’ in ‘struct main()::__lambda0’
          class function_input_iterator
                ^
 /home/wygos/libs/boost_1_55_0/include/boost/iterator/function_input_iterator.hpp:48:17:
 error: no type named ‘result_type’ in ‘struct main()::__lambda0’
                  dereference() const {
                  ^
 /home/wygos/libs/boost_1_55_0/include/boost/iterator/function_input_iterator.hpp:59:62:
 error: no type named ‘result_type’ in ‘struct main()::__lambda0’
              mutable optional<typename Function::result_type> value;

 Suggested solution:
    function_input_iterator should use boost::result_of

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9631>
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:15 UTC