Andrei Alexandrescu <seewebsiteforem...@erdani.org> wrote:
I do want to introduce syntax for expansion a la
auto (a, b) = foo(42);
because that's a common need that's not satisfiable via a library. But
then I want to define the syntax in a general way so it works not only
with tuples, but also with arrays and types that implement opIndex.
Philippe Sigaud's reftuple[1] from dranges does that first part:
int a, b;
_(a,b) = tuple(b,a); // swap
_(a,b) = tuple(b,a+b); // fibonacci
[1]:
http://svn.dsource.org/projects/dranges/trunk/dranges/docs/reftuple.html
--
Simen