On Sun, 23 Nov 2014 22:51:48 +0000 Freddy via Digitalmars-d-learn <[email protected]> wrote:
> I know what this does, but can someone explain how it works?
> ----
> static if((typeof((inout int=0){
>
> })));
> ----
it was here somewhere. this is, as you can see, a lambda. `typeof()`
can be used even for invalid code and will return special `error` type
(don't try to catch it, just trust me ;-). in `static if` this `error`
type means `false`. labmda that can not be compiled is obvious invalid,
uncompilable code, so it has a type of `error`.
and `inout` is a hack for some kind of functions/templates.
to make a long story short: don't try to remember it all, you'll forget
it next day. just take it as it is and be happy. ;-)
signature.asc
Description: PGP signature
