On Tuesday, 11 February 2014 at 15:57:33 UTC, Tobias Pankrath wrote:
On Tuesday, 11 February 2014 at 15:10:57 UTC, Carl Sturtivant wrote:
void main() {
//conversions from string part of the definitions of Data, Data2 f( "hello", "bonjour"); //no way to do this --- disappointing
}

See
http://forum.dlang.org/thread/[email protected]

Function calls are a more complicated case because of overload resolution.

If f(string, string) is defined, this will a) break silently or b) require qualification. Both is disappointing, too.

I do not understand why your (a) and (b) provably must be so. Please supply an argument: there seem to be other possibilities and without a proof that there are not, we may as well seek to do the right thing.

In the absence of such comprehension on my part, it seems to me that what's needed are some consistent rules that generalize the overloading rules about the interaction of opPass and overloading, with some priorities so that the best match is found. Perhaps some combinations of opPass and overloading should be illegal. Not that I've thought this through. :)

But is there a good reason why there isn't a reasonable such set of rules in principle? And if not, why do we not have opPass? Overtly converting all over the place is less than a happy situation.


Reply via email to