[swift-evolution] [pitch] One-sided Ranges

Brent Royal-Gordon brent at architechies.com
Thu Apr 13 21:58:40 CDT 2017


> On Apr 13, 2017, at 7:29 PM, Félix Cloutier via swift-evolution <swift-evolution at swift.org> wrote:
> 
> template<typename... T>
> void foo(T... args)
> {
> 	return bar(args...);
> }
> 
> In this bad but simple example, bar is called with the same* parameters as foo. Parameter unpacking uses the postfix … operator.
> 
> * To some extent. Doing the right thing adds a lot of noise.


I want to see tuple splat and variadic generics one day, but I think partial ranges will be used more often. We can give parameter unpacking a heavier syntax.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list