J
Joseph Turian
Hi guys,
I have a class defined as follows:
template <class T>
class Foo {
Foo(bool (*greater_than)(T, T));
...
};
i.e. it is a templatized class, which is given a certain binary
predicate as a comparison function.
The only problem is that I'm not sure how to construct a Foo object
using operator>.
e.g.
Foo<unsigned> foo(&(operator>));
doesn't work as desired.
Can someone please tell me to the proper syntax?
I'm probably only going to use numerical types for T, and pass in
either operator< or operator>.
Thanks,
Joseph
I have a class defined as follows:
template <class T>
class Foo {
Foo(bool (*greater_than)(T, T));
...
};
i.e. it is a templatized class, which is given a certain binary
predicate as a comparison function.
The only problem is that I'm not sure how to construct a Foo object
using operator>.
e.g.
Foo<unsigned> foo(&(operator>));
doesn't work as desired.
Can someone please tell me to the proper syntax?
I'm probably only going to use numerical types for T, and pass in
either operator< or operator>.
Thanks,
Joseph