With class template argument deduction we can write:
std::less Fn;
However, G++ 8.2 rejects this code:
#include <algorithm>
#include <vector>
#include <functional>
int main()
{
std::vector v= { 1, 3, 2, 7, 5, 4 };
std::sort(v.begin(),v.end(),std::greater());
}
emitting the following error:
error: cannot deduce template arguments for 'greater' from ()
Clang++ 7.0 and MSVC 15.8.0 compile it without warnings. Which compiler is right?