No parenthesis for assert?

Alex Rønne Petersen xtzgzorex at gmail.com
Thu Jan 12 04:31:19 PST 2012


Hi,

Is there any reason parentheses are required on asserts?

It would be much neater to be able to write:

assert x != 0;

than:

assert(x != 0);

By making parentheses optional, it would also feel more like a language 
feature than some sort of function. I realize optional parentheses 
wouldn't be useful if you're passing a message to assert, but I think 
for all other use cases, it would be a nice thing to have.

- Alex


More information about the Digitalmars-d mailing list