auto ref and non-templated functions

Namespace rswhite4 at googlemail.com
Tue Dec 25 02:14:40 PST 2012


> What does this generate?
>
> auto foo(auto ref S a, auto ref S b, auto ref S c, auto ref S 
> d) { ... }
>
> 16 different functions, one for each combination? Sounds like a 
> bad idea.

In my opinion, this should produce only two functions:
#1: auto foo(ref S a, ref S b, ref S c, ref S d) { ... }
#2: auto foo(S a, S b, S c, S d) { ... }


More information about the Digitalmars-d mailing list