[Gllug] C++ Templates, Opinions?

Nix nix at esperi.org.uk
Sun Dec 19 23:42:41 UTC 2004


On Sun, 19 Dec 2004, Holger Duerer whispered secretively:
>>>>>> "Nix" == Nix  <nix at esperi.org.uk> writes:
>   [...]
> 
>     Nix> Oh, Alexandescu is *smart*. Policy classes are a *genius* idea.
>     Nix> The only problem with template metaprogramming is that because
>     Nix> it wasn't actually an original design feature of C++, its
>     Nix> syntax is rather baroque and hard to read.
> 
> While very true, this statement hides the biggest problem with
> templates in today's compilers: If you think the template source code
> is difficult to read then you will be completely lost with the error
> messages produced when things go wrong.  With current compiler
> technology templates are only for writing correct code (the compiler
> won't help you much if you write wrong code) -- and we all know how
> easy that is...

That's a sucky compiler, though, not anything else. GCC 2.95.x was
so bad at this it was laughable: miss off one semicolon, get a
100K-long error message :)

GCC 3.4 should be much, *much* better at this than earlier GCC's;
4.0 will be better yet.

-- 
`The sword we forged has turned upon us
 Only now, at the end of all things do we see
 The lamp-bearer dies; only the lamp burns on.'
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list