$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Matthias Kaeppler (nospam_at_[hidden])
Date: 2005-02-27 13:44:41
Consider this code:
vector<int> coll;
// ... push back some values
vector<int*> ptrcoll;
// ... push back pointers to the values of coll
indirect_iterator< vector<int*>::iterator > begin(ptrcoll.begin()),
end(ptrcoll.end());
sort( begin, end, less<int> );
-- My question: After the sort statement, coll is sorted, right? (and ptrcoll is not). However, I need to sort a vector of pointers according to a predicate which applies to non-pointers. In this case, I want to sort ptrcoll, according to the less-relation on the pointees in coll. How can I achieve that? -- Matthias Kaeppler