Struct toString works but not std.conv.to!string

Nordlöw via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Oct 13 14:07:07 PDT 2015


I have defined a struct UTCOffset in

https://github.com/nordlow/justd/blob/master/datetime_ex.d

Everything works as desired except for

     import std.conv : to;
     assert(UTCOffset(+14, 0).to!string == "UTC+14:00");

which fails as

/usr/include/dmd/phobos/std/conv.d(293,14): Error: template 
instance isRawStaticArray!() does not match template declaration 
isRawStaticArray(T, A...)
datetime_ex.d(129,29): Error: cannot resolve type for 
UTCOffset(cast(ubyte)0u).this(cast(byte)14, 
cast(ubyte)0u).to!string

I don't understand what's wrong.


More information about the Digitalmars-d-learn mailing list