add attributes to debug

Gorge Jingale via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 24 14:33:20 PDT 2016


To allow for different debug versions without having to go full 
blown version().

@mem debug do something memory wise

@see debug write a message to console

Then these different attributed versions can be disabled. it 
could be something like

version(debug(see)) = none;

or

static if (hasAttribute(debug, @mem)) disable @mem;

or from the command line or whatever.

What makes this useful is we can easily assign different debug 
types(could be generalized to other versions(release, etc)) and 
not have to use version(longer and requires defines of the 
identifier).





More information about the Digitalmars-d mailing list