std.conv.to!string(array), strange compile error

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Nov 14 06:30:05 PST 2015


On 14.11.2015 15:17, Relja wrote:
> - std.conv.to!string() works on a static array, when called directly on
> the array object, but gives the compile error when called on the
> returning object from a function.
[...]
> void main() {
>      getFloat3().to!string; // does not compile
>      (new float[3]).to!string; // compiles
> }

`new float[3]` is not a static array. Its type is not `float[3]`, it's 
`float[]`.


More information about the Digitalmars-d-learn mailing list