l4-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++


From: Michal Suchanek
Subject: Re: C++
Date: Mon, 9 Nov 2009 14:20:07 +0100

2009/11/9 William Leslie <address@hidden>:
> The unfortunate thing about C++ templates in relation to the
> polyinstantiation that languages like some ML dialects implement
> (besides the unintelligible error messages, which are the deal breaker
> for me) is that they really are compile-time code generation.  The
> problem is that the template has to be /included/ in any using code.
> This means that two compilation units that use minimum<int> will each
> have their own instance of it.
>
> It seems like it would be difficult to reason about how much
> duplication would occur in a largeish project.  Worse, because you
> can't put them into a library and have template parameters resolved at
> link time, changes to templates require rebuilding all the code that
> uses them.  It's a very inconvenient way to achieve code reuse IMHO.
>

It's the same as #defines, it's just intelligible syntax for them. And
having intelligible syntax is an advantage IMHO.

Thanks

Michal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]