digitalmars.D.learn - Compiler support for T(n) notation for initialization of variables
- Joseph Rushton Wakeling via Digitalmars-d-learn (7/7) Jun 07 2014 Hello all,
- Peter Alexander (3/3) Jun 07 2014 Well, it doesn't work in 2.065, so must be 2.066 :-)
- Joseph Rushton Wakeling via Digitalmars-d-learn (8/10) Jun 07 2014 I only discovered it when I was advised to use it in a recent Phobos PR ...
- bearophile (4/7) Jun 07 2014 In 2.066.
- Joseph Rushton Wakeling via Digitalmars-d-learn (2/6) Jun 07 2014 Thanks for the confirmation :-)
Hello all, Just a quick check -- which version of the dmd frontend introduces support for the notation T(n) to initialize a variable as type T? Is it 2.065 or the upcoming 2.066? I ask because as I'm always running git-HEAD DMD, I'm never entirely on top of what's in which version ... :-) Thanks & best wishes, -- Joe
Jun 07 2014
Well, it doesn't work in 2.065, so must be 2.066 :-) P.S. thanks for letting me know about this feature. I had no idea it was going in!
Jun 07 2014
On 07/06/14 19:57, Peter Alexander via Digitalmars-d-learn wrote:Well, it doesn't work in 2.065, so must be 2.066 :-) P.S. thanks for letting me know about this feature. I had no idea it was going in!I only discovered it when I was advised to use it in a recent Phobos PR of mine. :-) The reason I wanted to know is to check whether or not it was "safe" to use it in library code that might conceivably be used with earlier compilers. I think requiring 2.065+ is reasonable, but requiring 2.066 obviously is not. Oh well, (cast(T) 1) it is then. :-( (I think that to!T will also work with a compile time constant, but it feels a bit dodgy to import std.conv for something like this.)
Jun 07 2014
Joseph Rushton Wakeling:which version of the dmd frontend introduces support for the notation T(n) to initialize a variable as type T? Is it 2.065 or the upcoming 2.066?In 2.066. Bye, bearophile
Jun 07 2014
On 07/06/14 19:57, bearophile via Digitalmars-d-learn wrote:Joseph Rushton Wakeling:Thanks for the confirmation :-)which version of the dmd frontend introduces support for the notation T(n) to initialize a variable as type T? Is it 2.065 or the upcoming 2.066?In 2.066.
Jun 07 2014