[Issue 2779] alias this + tuple expansion on function call doesn't work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 22 11:44:36 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=2779



--- Comment #17 from Andrei Alexandrescu <andrei at metalanguage.com> 2011-07-22 11:44:32 PDT ---
(In reply to comment #15)
> Say we have this:
> 
> struct Foo
> {
>     int value;
>     alias value this;
> }
> 
> If an "instance" of Foo is passed to a function taking variadic arguments then
> it's received as Foo and not int, correct? Why would an alias this with a tuple
> behave any different. In that case you would have to manually expand it.

This is not only about variadic arguments, sorry for being confusing. It is
about the combinatorial explosion when overloading rules meet automatic
expansion. Again, please consider this example:

fun(t1, t2, t3, t4);

and consider:

* fun may have an arbitrary number of overloads
* Some or all of t1 through t4 may be tuples, some also including tuples of
tuples

The fact that there exists an algorithm to find an expansion (albeit in
potentially a long time) is little solace when we consider the complexity
inflicted on the human reader.

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


More information about the Digitalmars-d-bugs mailing list