lazy evaluation of logical operators in enum definition

Meta jared771 at gmail.com
Thu Apr 19 03:36:50 UTC 2018


On Wednesday, 18 April 2018 at 10:19:20 UTC, Atila Neves wrote:
> On Wednesday, 18 April 2018 at 04:44:23 UTC, Shachar Shemesh 
> wrote:
>> On 17/04/18 13:59, Simen Kjærås wrote:
>>> [...]
>>
>> Also, extremely dangerous.
>>
>> Seriously, guys and gals. __traits(compiles) (and its uglier 
>> sibling, is(typeof())) should be used *extremely* sparingly.
>>
>> [...]
>
> A very good rule of thumb. I've lost of how many times I've had 
> a bug because of __traits(compiles) being false, but not in the 
> way I expected it to be!

Let me third that.

Although this would not be as big of a problem if we had a way of 
printing out the values for failed template constraints (isn't 
this already done for static if now?)


More information about the Digitalmars-d mailing list