Final by default?

Ali Çehreli acehreli at yahoo.com
Wed Mar 12 16:14:19 PDT 2014


On 03/12/2014 03:50 PM, Walter Bright wrote:

 > So, there's the solution that has been proposed before:
 >
 >     !final
 >     !pure
 >     !nothrow
 >     etc.

The same issue came up with 'version' recently. It is possible to start 
a version block like this:

     version(something):

However, it is not possible to get to the "else" part of that version 
block using the above syntax. Would the same syntax work for version as 
well?

     version(something):
         // ...

     !version(something):
         // ...

Note: Yes, it is possible to use curly braces for the same effect:

     version(something) {
         // ...

     } else {
         // ...
     }

The question is whether it makes sense to be consistent for version (and 
debug, etc.) as well.

Ali



More information about the Digitalmars-d mailing list