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

via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 2 01:32:09 PDT 2014


On Wednesday, 2 July 2014 at 07:07:18 UTC, Wanderer wrote:
> On Tuesday, 1 July 2014 at 01:13:25 UTC, Jonathan M Davis via 
> Digitalmars-d wrote:
>> The long term plan is to remove toString, opEquals, toHash, 
>> and opCmp from
>> Object so that the derived classes can decide whether to make 
>> them const or
>> not. Unlike Java and C#, we have proper templates, so we can 
>> templatize all of
>> the stuff in the runtime which uses those functions so that 
>> they don't have to
>> be on Object.
>
> Remove toString from the root of the object hierarchy?? How do 
> you plan to implement ~ operator for constructing strings?

What does the ~ operator have to do with it?

> It should work with any types, even unbeknown to each other.

I suppose the current `Object.toString` can be made a 
free-standing function that's automatically used (via UFCS) when 
there's no proper toString member on the class.


More information about the Digitalmars-d mailing list