|
|
От: | alzt | |
| Дата: | 10.06.08 12:04 | ||
| Оценка: | |||
struct MyPred : public std::binary_function<int*,int*, bool>
{
bool operator()(int* a, int* b)
{
return (*a<*b);
}
};
int _tmain(int argc, _TCHAR* argv[])
{
vector<int*> v;
v.push_back(new int(1));
v.push_back(new int(3));
v.push_back(new int(4));
v.push_back(new int(2));
sort(v.begin(),v.end(), MyPred());
//...
}