
Sumanth, Comparison operators are defined in tuple_comparison.hpp Sumanth J.V wrote:
#include "boost/tuple/tuple_io.hpp"
// add this line #include "boost/tuple/tuple_comparison.hpp"
#include <vector> #include <algorithm>
typedef boost::tuple
Task; typedef std::vector<Task> TaskSet;
// remove these // bool operator<(const Task& a, const Task& b) { // return boost::get<1>(a) < boost::get<1>(b); // }
int main(int argc, char** argv) { TaskSet ts;
ts.push_back( boost::make_tuple(0, 0, 0, 0) ); ts.push_back( boost::make_tuple(3, 3, 3, 3) ); ts.push_back( boost::make_tuple(2, 2, 2, 2) );
std::sort(ts.begin(), ts.end());
return 0; }
KevinH -- Kevin Heifner heifner @ ociweb.com http://heifner.blogspot.com Object Computing, Inc. (OCI) www.ociweb.com