I wonder if it is possible to use operator<
or some other as default parameter of some function.
Some stupid trivial example:
template <typename T>
void compare(std::function<bool(T, T)> lessThan = T::operator<);
I try to do this thing for int
as T
, but of course I get an error:
error: ‘operator<’ is not a member of ‘int’
I really don't know if it is possible till operator<
as I know isn't a static function.
Do you have any idea, if and how it can be done?
Any help will be apreciated! :)