default opAssign(string) behaviour

Pelle Månsson pelle.mansson at gmail.com
Thu Jan 28 01:58:20 PST 2010


On 01/28/2010 02:32 AM, strtr wrote:
> Personally, I use (D1)std2.conv a lot to get values from strings and thus would love the following default behaviour for all types:
>
> int i = "0"; // i = 0
> i = cast( int ) "0"; // i = 48 ( If I read the utf8 table correctly )
>
> What keeps this from being the case?

Strong typing, mostly. It's messy.

to!int("0") is seriously pretty, though. :)


More information about the Digitalmars-d-learn mailing list