J
Jerzie.Klenchier
Hi all,
I'm having some difficulty in getting the following piece of code to
compile:
#include <iostream>
#include <deque>
#include <algorithm>
#include <boost/tuple/tuple.hpp>
#include <boost/lambda/lambda.hpp>
int main(void)
{
typedef boost::tuples::tuple<unsigned int, double> my_tuple_type;
std::deque<my_tuple_type> my_list;
std::sort(my_list.begin(),my_list.end(),
(boost::lambda::_1).get<0>() <
(boost::lambda::_2).get<0>());
return 0;
}
my understanding of the lambda place-holders was that they represent
the value_type of the iterators in the above example. A simpler
example as below seems to work, just wondering why the above doesn't.
{
std::vector<int> v_list;
std::sort(v_list.begin(),v_list.end(),
boost::lambda::_1 < boost::lambda::_2);
}
Jerzie
I'm having some difficulty in getting the following piece of code to
compile:
#include <iostream>
#include <deque>
#include <algorithm>
#include <boost/tuple/tuple.hpp>
#include <boost/lambda/lambda.hpp>
int main(void)
{
typedef boost::tuples::tuple<unsigned int, double> my_tuple_type;
std::deque<my_tuple_type> my_list;
std::sort(my_list.begin(),my_list.end(),
(boost::lambda::_1).get<0>() <
(boost::lambda::_2).get<0>());
return 0;
}
my understanding of the lambda place-holders was that they represent
the value_type of the iterators in the above example. A simpler
example as below seems to work, just wondering why the above doesn't.
{
std::vector<int> v_list;
std::sort(v_list.begin(),v_list.end(),
boost::lambda::_1 < boost::lambda::_2);
}
Jerzie