good example of assert as expression ?

Timon Gehr timon.gehr at gmx.ch
Wed Feb 4 20:17:03 UTC 2026


On 2/3/26 20:58, user1234 wrote:
> Following a [previous thread](https://forum.dlang.org/thread/ 
> loojkahtbzigawrscmsr at forum.dlang.org), can you give me good example 
> where the assert expression is useful ?

auto x = c0 ? e0 :
          c1 ? e1 :
          c2 ? e2 :
          assert(0);

> I mean don't you think it's an obscure feature that could be removed ? 

Every feature can be removed. Should it be removed? No.


More information about the Digitalmars-d mailing list