You're Doing In-Conditions Wrong

FeepingCreature feepingcreature at gmail.com
Mon Jul 13 14:45:30 UTC 2020


On Monday, 13 July 2020 at 14:33:42 UTC, Adam D. Ruppe wrote:
> On Monday, 13 July 2020 at 14:29:45 UTC, Panke wrote:
>> I don't want any contract checking outside of debug mode.
>
> contracts are actually independent compiler switches you can 
> turn on and off separate from everything else. This is just 
> talking about two layers of checks, don't read too much into 
> the term "debug mode".

The idea here would be that the "expensive" two-step check would 
be limited to `-debug`, though I guess you could just always do 
it that way.

My ordering of preference is "check both in debug, check child 
without debug" > "check both (with LogicError/LiskovError) 
always" > "only check child always" > "current behavior".



More information about the Digitalmars-d mailing list