The empty statement ";" - when is it useful?

BCS none at anon.com
Sat Jul 25 14:13:59 PDT 2009


Hello KennyTM~,

> Andrei Alexandrescu wrote:
> 
>> D has ";" as the empty statement. In fact I think it's an empty
>> declaration because it can appear at top level.
>> 
>> When is it any good? The only place I can think of is after a label
>> 
>> blah: ;
>> 
>> But then you can always say
>> 
>> blah: {}
>> 
>> which is arguably less puzzling. Any other places?
>> 
>> Andrei
>> 
> for (; cond; inc) { ... }

for({} false; 42) {}

> 
> or as the result of a string mixin?
> 





More information about the Digitalmars-d mailing list