C++ guys hate static_if?

Dicebot m.strashun at gmail.com
Thu Mar 14 10:13:37 PDT 2013


On Thursday, 14 March 2013 at 17:07:16 UTC, Andrei Alexandrescu 
wrote:
> Very simple. Traditionally there's two crucial epochs known as 
> compilation time and run time. (There's some minor distinctions 
> like link time etc.) The whole notion of concepts and other 
> type systems for templates is predicated on three crucial 
> epochs: library compilation time, library user compilation 
> time, and run time. The logic goes, someone writes a generic 
> library and wants to distribute it to users. Users shouldn't 
> ever see bugs caused by e.g. typos in the library.
>
> So the crowd that use meta-type systems is formed of library 
> writers who want to distribute libraries without ever 
> instantiating them. I don't think that's a good crowd to cater 
> for.
>
> I've been surprised to figure how many people don't get this 
> flow, or only have a vague image of it. Although meta-types are 
> arguably "the right thing" to do, they're a lot less attractive 
> once it's clear what scenarios they help.

It is the very same reasoning. Meta-library developers are humans 
and make mistakes. Forgetting to cover instantiating some corner 
case in this example. If this won't compile, this bug won't 
persist all the way down to the user of this library, exactly the 
one we care most for.


More information about the Digitalmars-d mailing list