Does anybody have an example of overloading a function to accept char[] or string parameter

evilrat evilrat666 at gmail.com
Sun Mar 30 09:08:43 PDT 2014


On Sunday, 30 March 2014 at 15:58:52 UTC, Gary Miller wrote:

> Are there any alternate libraries for D that have a mutable 
> string datatype or is there a way to override the immutable 
> characteristic of the string datatype by reallocating it or 
> something?

string.dup property does a copy of original array(! note that 
this is array property and would work for any other arrays and 
slices).

you can have overloaded variant for strings but i think compiler 
would optimize to call everything as string variant, you can 
figure this out on your own.


More information about the Digitalmars-d-learn mailing list