Thread overview
version pairs?
Apr 10, 2016
Jay Norwood
Apr 10, 2016
hilop
Apr 11, 2016
Mike Parker
Apr 11, 2016
Jonathan M Davis
April 10, 2016
Seems like there should be an extra level to the version statement, something like version(arch,x86).

I must be missing something about the intended use of the version statement.

April 10, 2016
On Sunday, 10 April 2016 at 13:58:17 UTC, Jay Norwood wrote:
> Seems like there should be an extra level to the version statement, something like version(arch,x86).
>
> I must be missing something about the intended use of the version statement.

This will never be done. The language creator has strong arguments against that. If you search a bit on the forum you'll find the topics where the rationale is given.
April 11, 2016
On Sunday, 10 April 2016 at 13:58:17 UTC, Jay Norwood wrote:
> Seems like there should be an extra level to the version statement, something like version(arch,x86).
>
> I must be missing something about the intended use of the version statement.

What's wrong with version(X86)?
April 10, 2016
On Sunday, April 10, 2016 13:58:17 Jay Norwood via Digitalmars-d-learn wrote:
> Seems like there should be an extra level to the version
> statement, something like version(arch,x86).
>
> I must be missing something about the intended use of the version statement.

In most cases that I've seen, you only need one level of version statement - usually a version for the OS is all that's needed. The need for specifying the architecture is _very_ rare from what I've seen. But if you need more levels, then just nest version statements. e.g.

version(linux)
{
    version(X86)
    {
    }
    else version(X86_64)
    {
    }
}

There some places in druntime that nest like that (I think primarily to separate the various C runtimes on systems that don't have only one), but as it is, version statements of any kind aren't needed all that frequently in Phobos - and when they are, it's almost inevitably because they're wrapping C functionality. Pure D stuff tends to be system-agnostic and therefore not version-statement heavy.

- Jonathan M Davis