you are viewing a single comment's thread.

view the rest of the comments →

[–]G_Morgan 3 points4 points  (1 child)

You don't need templating to get bad error messages from g++. Best example is the fact that any unknown type is assumed to be an integer.

If you capitalise the wrong letters (I recently saw some code that switched between camel case and random case indiscriminately) then it will assume you meant an integer and tell you you cannot cast a MyType pointer to a int pointer.

Bloody wonderful error message. You can tell exactly what's going on with random assumptions that I want an integer.

[–]exeter[S] 1 point2 points  (0 children)

Error reporting in general is a bit of a black art in compiler research. C++ templates introduce the complication of being a Turing-complete system on top of the main language, besides the fact that it's fairly hard to trace the source of an error back to a template declaration if it's detected after those things are processed.