[Boost-bugs] [Boost C++ Libraries] #1821: lambda and transform_iterator

Subject: [Boost-bugs] [Boost C++ Libraries] #1821: lambda and transform_iterator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-04-12 20:12:22


#1821: lambda and transform_iterator
---------------------------------------+------------------------------------
 Reporter: ka3a4ok <bismuth_at_[hidden]> | Owner: dave
     Type: Bugs | Status: new
Milestone: Boost 1.36.0 | Component: iterator
  Version: Boost 1.35.0 | Severity: Problem
 Keywords: |
---------------------------------------+------------------------------------
 This code doesn't compile.


 {{{
 #include <utility>
 #include <list>
 #include <boost\iterator\transform_iterator.hpp>
 #include <boost\lambda\lambda.hpp>
 #include <boost\lambda\bind.hpp>
 #include <boost\function.hpp>

 int main(int argc, char* argv[])
 {
     using namespace std;
     using namespace boost;
     using namespace boost::lambda;

     typedef list<pair<int, double> > Tlist;

     make_transform_iterator
     ( Tlist().begin(),
          bind(&Tlist::value_type::first, _1)
     );

     return 0;
 }
 }}}

 ----

 But this does:


 {{{
 #include <utility>
 #include <list>
 #include <boost\iterator\transform_iterator.hpp>
 #include <boost\lambda\lambda.hpp>
 #include <boost\lambda\bind.hpp>
 #include <boost\function.hpp>

 int main(int argc, char* argv[])
 {
     using namespace std;
     using namespace boost;
     using namespace boost::lambda;

     typedef list<pair<int, double> > Tlist;

     make_transform_iterator
     ( Tlist().begin(),
          function<int(Tlist::value_type)>
          ( bind(&Tlist::value_type::first, _1)
          )
     );

     return 0;
 }
 }}}

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