Hello I have some touble overloading operators for std::list.
I store pairs in a list, consisting in an int value and a position array :
typedef std::pair< int, std::vector<int,3> > pointPairType;
typedef std::list< pointPairType > pointListQueueType;
pointListQueueType pointsQueue;
// adding some points to the list
And I would like to sort the list according to the first value of the pair, I though that would work :
creating a comparison class,
and feeding the short algorithm with it :
// comparison function
template < class T1, class T2 >
class compareFirst
{
public:
bool operator() (const std::pair<T1,T2>& l, const std::pair<T1,T2>& r)
{
return l.first < r.first;
}
};
... and in main :
// use of sorting algorithm : error here
pointsQueue.sort(< int, std::vector<int,3> >compareFirst);
But I get an "expected primary expression before '<' token
Any help would be greatly appreciated ! thanks !