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

2015-11-14 Thread BBaz via Digitalmars-d-learn
On Saturday, 14 November 2015 at 12:46:21 UTC, Relja wrote: I've got this strange compile error using std.conv.to!string(double[3]) - or any static array type. It's called in toString override function of a template matrix class, I'm building as a D learning project. [...] Maybe try to use

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

2015-11-14 Thread Relja via Digitalmars-d-learn
On Saturday, 14 November 2015 at 12:55:52 UTC, BBaz wrote: On Saturday, 14 November 2015 at 12:46:21 UTC, Relja wrote: I've got this strange compile error using std.conv.to!string(double[3]) - or any static array type. It's called in toString override function of a template matrix class, I'm

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

2015-11-14 Thread anonymous via Digitalmars-d-learn
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

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

2015-11-14 Thread Relja via Digitalmars-d-learn
On Saturday, 14 November 2015 at 14:30:06 UTC, anonymous wrote: 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() {

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

2015-11-14 Thread Relja via Digitalmars-d-learn
I've got this strange compile error using std.conv.to!string(double[3]) - or any static array type. It's called in toString override function of a template matrix class, I'm building as a D learning project. Here is the toString method: override string toString() const { string outs;

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

2015-11-14 Thread anonymous via Digitalmars-d-learn
On 14.11.2015 15:40, Relja wrote: float[3] array; array.to!string; // compiles Alright, full test case: import std.conv; float[3] getFloat3() { return [1, 2, 3]; } void main() { getFloat3().to!string; // does not compile float[3] a; a.to!string; // compiles }

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

2015-11-14 Thread Relja via Digitalmars-d-learn
On Saturday, 14 November 2015 at 18:52:54 UTC, anonymous wrote: On 14.11.2015 15:40, Relja wrote: [...] Alright, full test case: import std.conv; [...] Great explanation! Thank you!