Chris Vine <chris@cvine--nospam--.
freeserve.co.uk> wrote:
> As I read it, he asked about the specialization of std::greater<void>
> which allows type deduction in its call operator. That was made
> available in C++14.
I was, in fact, asking about both things.
It was completely mysterious to me how exactly std::greater would
know that it was supposed to be comparing doubles, when nowhere in
its instantiation it's told that. I didn't know that it has a
specialization for void that works for exactly this kind of situation.
It's also a bit unclear to me how it works without the empty <>
brackets. I know it's related to C++ automatic template type
deduction, but it's unclear to me how it works in this case.
Curiously, it appears that it works without any explicit deduction
guides. It works for the mere reason that the default template
parameter for std::greater is void.
The rules of automatic template parameter type deduction are still
a bit unclear to me.