"evilrat"  wrote in message news:mxhmgkljrzqhaymec...@forum.dlang.org...
On Friday, 28 February 2014 at 04:19:47 UTC, Etienne Cimon wrote:
>
> How do you stop statements from belonging to the specific version of > code without using brackets?

add "version(all):" after code where specific version ends.

This is incorrect, there is no way to do this.

The compiler translates
version(...):
...

into
version(...)
{
...
}

So any version labels after the first are moved inside the first.

You can see it with this code:

version = y;
version(x):
pragma(msg, "versionx");
version(y):
pragma(msg, "versiony");

Nothing is printed, because the version(y) block is inside the version(x) block, and version(x) is not set.

The answer: use braces.

Reply via email to