A Small Enhancement Idea

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 3 12:11:33 PDT 2015


On 09/02/2015 06:32 PM, H. S. Teoh via Digitalmars-d wrote:
> On Wed, Sep 02, 2015 at 04:28:10PM +0000, Jack Stouffer via Digitalmars-d wrote:
>> I wanted some second opinions on an idea I had for D before I made a
>> bugzilla issue.
>>
>> Currently in D, to have a statement run only in debug mode, you can mark it
>> with the debug keyword. But, there is currently no way to mark a statement
>> so that it only runs in release. So what I propose is a release statement
>> like so:
>>
>> debug {
>>      // only runs when -debug is given
>> }
>>
>> release {
>>      // only runs when -release is given
>> }
>
> 	debug {
> 		...
> 	}
> 	version(release)
> 	{
> 		...
> 	}
>
>
> T
>

Tested with DMD 2.068.0. This does not work.


More information about the Digitalmars-d mailing list