toString vs. toUtf8

Lars Ivar Igesund larsivar at igesund.net
Tue Nov 20 12:46:11 PST 2007


Sean Kelly wrote:

> Christopher Wright wrote:
>> 
>> class String {
>>    char[] opImplicitCast () {}
>>    wchar[] opImplicitCast () {}
>>    dchar[] opImplicitCast () {}
>> }
>> 
>> String toString () {}
>> 
>> How does that look?
> 
> Tango already has a String class with toUtf8, toUtf16, and toUtf32
> member functions.  This was one of our original objections to the idea
> of toString as a member function that must return a char[].  We will
> have to rename the class to something else if this change goes through.
> 
> 
> Sean

It is already renamed to Text.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource, #d.tango & #D: larsivi
Dancing the Tango



More information about the Digitalmars-d mailing list