4 ms·
> So if I try to use this template with the wrong type, after a bunch of template and macro expansion the compiler will print out a cryptic error showing the te
by vmarsy 10y ago
> So if I try to use this template with the wrong type, after a bunch of template and macro expansion the compiler will print out a cryptic error showing the templated code and the failed type substitution.
This is one of the reasons why Andrew Sutton and Bjarne Stroustrup are trying to push C++ Concepts since C++11 [1]. They should provide much easier to understand compile time errors when it comes to templates.
[1] https://en.wikipedia.org/wiki/Concepts_(C%2B%2B) https://en.wikipedia.org/wiki/Concepts_(C%2B%2B)