Bug or Feature? compile error: to!string(const Object)

francesco cattoglio via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 30 15:22:50 PDT 2014


I found out today that the following code won't compile:

import std.conv;

class MyClass {}

void doStuffKo(const MyClass instance)
{
	string temp = to!(string)(instance);	
}

Everything compiles fine if I remove the const from the function 
signature.
I found out this issue named in earlier threads but I could not 
find any bug about it on the issue tracker. Is this a bug, a 
missing feature, or is this something that is almost impossible 
to achieve and therefore not implemented on purpose?


More information about the Digitalmars-d mailing list