assert vs enforce.

bearophile bearophileHUGS at lycos.com
Fri Dec 20 15:27:22 PST 2013


TheFlyingFiddle:

> When should i use enforce instead of assert?

Others have already told you most of the answer. Let me add that 
enforce() is heavier for the compiler, so don't put an enforce in 
a performance-critical path in your code.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list