I have a lot types to use compare functors, and I would like to see if there is way to simplify it without passing the argument. Here is a dummy code example:
struct Base{};
template<typename T> struct Compare {
bool operator()(const T& a, const T& b) {
return true;
}
};
int main()
{
Base b1, b2;
Compare(b1, b2);
return 0;
}
Unfortunately, this does not work https://godbolt.org/z/q56c3coaT. But then I wonder how c++17 std::less could work, or there is any way to do it?