C++ guys hate static_if?

deadalnix deadalnix at gmail.com
Mon Mar 11 22:49:34 PDT 2013


On Tuesday, 12 March 2013 at 04:34:05 UTC, Walter Bright wrote:
> On 3/11/2013 8:43 PM, deadalnix wrote:
>> Yes, that is the idea. It seems really cool.
>
> It's interfaces without the vtable[].
>
> It's still solely based on type signatures. D constraints make 
> pretty much anything that can be computed at compile time a 
> testable gate.

Yes, but that allow static checking. The argument is the same as 
for dynamic vs static typing. In PHP for instance, you can do 
thing like :

if(is_string($foo)) {
     // handle the case for string
} else {
     // Do something else
}

And this is very similar to our template constraint system and 
static if, except we are meta here (ie, meta dynamic typing vs 
meta static typing).


More information about the Digitalmars-d mailing list