On Thursday, 23 February 2017 at 18:35:29 UTC, Profile Anaysis
wrote:
[...]
option 1 is the one I was shooting for. does the static if
(audio) just check for the existence of audio, or does it also
check to see if audio is true as well?
Yes, but it checks at compile time. So the code will
There are a few options:
1. static if(audio)
2. version(audio)
3. if (audio)
It looks like you are trying to create the version(audio)
semantic(if exists then use, else don't).
Ultimately, though, if you are trying to make a binary that
can either use audio or not depending on where it is ra
On Wednesday, 22 February 2017 at 22:37:25 UTC, Profile Anaysis
wrote:
On Wednesday, 22 February 2017 at 21:27:47 UTC, WhatMeWorry
wrote:
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
On Wednesday, 22 February 2017 at 21:27:47 UTC, WhatMeWorry wrote:
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)
On Wednesday, 22 February 2017 at 21:27:47 UTC, WhatMeWorry wrote:
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)
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, b