"instanceOf" trait for conditional implementations

monarch_dodra monarchdodra at gmail.com
Thu Oct 4 14:04:48 PDT 2012


On Thursday, 4 October 2012 at 17:57:51 UTC, Simen Kjaeraas wrote:
> [SNIP]
>
> @property T instanceOf( T )( );
>
> [SNIP]

Awesome! It is much more robust too! I still don't understand how
*my* instanceOf!(immutable(S)) works :/

I'd just change it to:
@property ref T instanceOf( T )( );
So that instanceOf acts as an LValue.

Having a link error is great too. A compile error would be best,
but unachievable actually, so still pretty good.


More information about the Digitalmars-d mailing list