digitalmars.D.learn - am I using version right?
- DFTW (15/15) Mar 12 2019 version(Windows)
- Adam D. Ruppe (2/5) Mar 12 2019 yes, that's right.
version(Windows) { writeln("Hello from Windows system!"); } else version(linux) { writeln("hello from linux!"); } else static assert(0, "unknow system!"); In that code, the static assert() will run if and only if neither version condition is true, i.e, the OS is neither Windows nor linux. Correct? My question is due version-else, I'm unsure if version-else works the way it does with regular if and the static assert() will not run at compile-time, regardless whether version is true
Mar 12 2019
On Tuesday, 12 March 2019 at 17:07:11 UTC, DFTW wrote:In that code, the static assert() will run if and only if neither version condition is true, i.e, the OS is neither Windows nor linux. Correct?yes, that's right.
Mar 12 2019