Template constraints: opCmp and opUnary!"++"

Francesco Cattoglio francesco.cattoglio at gmail.com
Fri Dec 20 09:33:25 PST 2013


On Friday, 20 December 2013 at 17:18:01 UTC, Timon Gehr wrote:
> On 12/20/2013 05:40 PM, monarch_dodra wrote:
>>
>> That's normal, because "T.init" is not an lvalue.
>>
>> If you need an lvalue, we have `std.traits.lvalueOf!T` which 
>> you
>> can use.
>
> is(typeof((T v){ /+ use v +/ }))
>
> I think this is a lot cleaner.

Is there any difference between "is(typeof(<somecode>))" and 
__traits(compiles, <somecode>)?


More information about the Digitalmars-d-learn mailing list