On 3/8/12 2:38 AM, Tyler Jameson Little wrote:
I would like to do something like this:

version (linux || BSD) {
// do something...
} else {
version (Windows) {
// do something else
} else {
// do something else
assert(false, "Unsupported operating system");
}
}

The only way I've been able to do this, is by splitting up the two
versions and repeat code.

Is there a better way to do this? A static if can do this, so is there a
way that I can use a static if somehow?

I don't think it would be hard to implement boolean logic inside version.

Would it make sense if I make a pull request for it?

(because every now and then somebody stumbles upon this issue, and it looks like it could be implemented really easily)

Reply via email to