Re: string, char[], overloaded functions.

2014-11-02 Thread dajones via Digitalmars-d-learn
Adam D. Ruppe destructiona...@gmail.com wrote in message news:xxnfghisussknbqzv...@forum.dlang.org... On Friday, 31 October 2014 at 23:59:54 UTC, dajones wrote: So shouldnt char[] implicity convert to string Nope, char[] casting to string is generally a bad thing that should be avoided

Re: string, char[], overloaded functions.

2014-11-02 Thread dajones via Digitalmars-d-learn
Kagamin s...@here.lot wrote in message news:lccftxangprboitrt...@forum.dlang.org... On Friday, 31 October 2014 at 23:59:54 UTC, dajones wrote: is there a better way than doing... cast(string)(buf~hoo) to get it to pick the correct overload? text(buf,hoo) Thanks! chris

Re: string, char[], overloaded functions.

2014-11-02 Thread dajones via Digitalmars-d-learn
Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote in message news:mailman.1363.1414801299.9932.digitalmars-d-le...@puremagic.com... On Friday, October 31, 2014 23:58:43 dajones via Digitalmars-d-learn wrote: Ok, void Foo(string name, string value); void Foo

string, char[], overloaded functions.

2014-10-31 Thread dajones via Digitalmars-d-learn
Ok, void Foo(string name, string value); void Foo(string name, int value); then... char[] buf = woo.dup; Foo(bar,woohoo); // works ok Foo(bar,buf~hoo); // fails, error says cant match params (string, int) So shouldnt char[] implicity convert to string, and hence match the (string,string)