Thread overview | |||||
---|---|---|---|---|---|
|
March 12, 2014 Compiler version at compile-time | ||||
---|---|---|---|---|
| ||||
Is there a way to determine the compiler version at compile time? Something like: static if(DMD_VERSION >= 2.066) { virtual int foo(); } else { int foo(); } |
March 12, 2014 Re: Compiler version at compile-time | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Eagen | On Wednesday, 12 March 2014 at 02:46:30 UTC, David Eagen wrote:
> Is there a way to determine the compiler version at compile time? Something like:
>
> static if(DMD_VERSION >= 2.066) {
> virtual int foo();
> } else {
> int foo();
> }
Naturally I found it as soon as I posted....
std.compiler : version_major, version_minor;
|
March 12, 2014 Re: Compiler version at compile-time | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Eagen | On Wed, Mar 12, 2014 at 02:53:41AM +0000, David Eagen wrote: > On Wednesday, 12 March 2014 at 02:46:30 UTC, David Eagen wrote: > >Is there a way to determine the compiler version at compile time? Something like: > > > >static if(DMD_VERSION >= 2.066) { > > virtual int foo(); > >} else { > > int foo(); > >} > > Naturally I found it as soon as I posted.... > > std.compiler : version_major, version_minor; There's also __VERSION__: static if (__VERSION__ > 2065L) { ... } T -- Unix was not designed to stop people from doing stupid things, because that would also stop them from doing clever things. -- Doug Gwyn |
Copyright © 1999-2021 by the D Language Foundation