Proposal: Object/?? Destruction

jmh530 john.michael.hall at gmail.com
Fri Oct 6 19:43:53 UTC 2017


On Friday, 6 October 2017 at 19:31:11 UTC, Timon Gehr wrote:
> The proposal is to make all arguments "single type arguments". 
> The "single type" might be a tuple. A tuple type is just a 
> type, after all. For two current functions where only one 
> matches but after the change both would match, the same one 
> would still be selected, because it is more specialized.
>
> [snip]
> Then the call foo(2) will still go to the first overload and 
> the call foo(1,2) will still go to the second overload, while 
> the call foo(1,2,3) will still go to the third overload.


So under your thinking, the original example should have been 
something like:

---
auto id(T)(T x){ return x; }

void main(){
     auto a = id(2); // ok, a is 2.
     auto b = id(1,2); // error, b is not single type argument
     auto c = id(1,); // ok, c is 1.
     auto d = id((1,2)); // ok, d is (1,2)
     auto e = id((1,)); // ok, e is (1,)
}
---


More information about the Digitalmars-d mailing list