C++ guys hate static_if?

deadalnix deadalnix at gmail.com
Thu Mar 14 08:50:29 PDT 2013


On Thursday, 14 March 2013 at 15:38:53 UTC, Andrei Alexandrescu 
wrote:
> On 3/14/13 11:05 AM, monarch_dodra wrote:
>> Having to instantiate a template just to check to make sure it 
>> is
>> semantically correct is a huge pain.
>
> I'm not sure about that. The way I see it, no code should be 
> not delivered without being unittested. Ubiquitous unittesting 
> is now mainstream. The way I see it, a type system on top of 
> templates would only help people who don't write unittests.
>
> Andrei

The same argument can be made when talking about dynamic vs 
static typing.

This is usualy much better to have the compiler smash your 
mistake right into your face than discovering with a unittest 
much latter.

I don't say that unittest are useless, but why rely on unittest 
when the machine can do the job for you ?


More information about the Digitalmars-d mailing list