[Issue 11900] Implicit cast of string literal -> char* causing ambiguous call

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 10 23:22:21 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11900



--- Comment #3 from Jakob Ovrum <jakobovrum at gmail.com> 2014-01-10 23:22:19 PST ---
(In reply to comment #2)
> Well it's kinda like you say, this overload set is very common, if you have a C
> function, and you want to produce a D wrapper which receives a string and calls
> through using toStringz.

The ambiguity with string literal arguments probably means it's not overly
common at this stage, but regardless, its popularity does not justify its use.
We have no obligation to make concessions to enable bad code.

> Otherwise you find yourself typing toStringz all over
> the place, and it interferes with fp/delegates/generic code that deals with
> strings.

Yes, this is an unappealing alternative. I just think/hope it's not the only
alternative.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list