I'm doing conditional compilation using static ifs like so:

enum bool audio       = true;



// if audio flag is present and set to true, add to code build

static if ( (__traits(compiles, audio)) && audio)                               
        
    playSound(soundSys, BLEEP );


This works, but I thought there might be a simpler way. For instance,
after perusing std.traits, I thought I would find something like
isPresent(audio) or isSymbol(audio) templates.

Or am I being obtuse here?

Thanks.

Reply via email to