4 ms·
I was asking about the no-concept case. I was thinking something like this: Compiler encounters operator<(T) on argument (type T) is called. In best case it
by chakkepolja 5y ago
I was asking about the no-concept case.
I was thinking something like this:
Compiler encounters operator<(T) on argument (type T) is called.
In best case it sees it was a function parameter. In worst case it at least sees concrete type of the parameter. Let's say that type is UserData
It will say that UserData type needs to implement UserData::operator<(UserData) to be able to use min() function.
Of course I can see this getting complex as nesting etc.. increase. But I am wondering if clang (since it's selling points include error messages, though gcc is catching up), hasn't tried something like this, there must be a fundamental technical difficulty for generalizing such a technique.