Search⌘ K

version(tag) and version(level)

Get introduced to the version feature of conditional compilation in D.

We'll cover the following...

version is similar to debug and is used in the same way:

version(testRelease) /* ... an expression ... */;

version(schoolRelease) {
    /* ... expressions that are related to the version of
    * this program that is presumably shipped to schools ... */

} else {
    // ...  code compiled otherwise ...
}

version(1) aVariable = 5;

version(2) {
    // ... a feature of version 2 ...
}
...