W
Wenjie
Hello,
In the SGI STL documentation:
struct less_mag : public binary_function<double, double, bool> {
bool operator()(double x, double y) { return fabs(x) < fabs(y); }
};
vector<double> V;
...
sort(V.begin(), V.end(), less_mag());
I am a little confused concerning 'less_mag()': does it construct
some less_mag object? Then what should be the constructor and could
it be written as 'less_mag'? If it is calling operator(), I don't
think so
Thanks for your enlightment,
Wenjie
In the SGI STL documentation:
struct less_mag : public binary_function<double, double, bool> {
bool operator()(double x, double y) { return fabs(x) < fabs(y); }
};
vector<double> V;
...
sort(V.begin(), V.end(), less_mag());
I am a little confused concerning 'less_mag()': does it construct
some less_mag object? Then what should be the constructor and could
it be written as 'less_mag'? If it is calling operator(), I don't
think so
Thanks for your enlightment,
Wenjie