string is rarely useful as a function argument

bearophile bearophileHUGS at lycos.com
Wed Dec 28 04:42:46 PST 2011


Peter Alexander:

> I often get into situations where I've written 
> a function that takes a string, and then I can't call it because all I 
> have is a char[].

I suggest you to show some of such situations.


> I think it's telling that most Phobos functions use 'const(char)[]' or 
> 'in char[]' instead of 'string' for their arguments. The ones that use 
> 'string' are usually using it unnecessarily and should be fixed to use 
> const(char)[].

What are the Phobos functions that unnecessarily accept a string?

Bye,
bearophile


More information about the Digitalmars-d mailing list