Comma expressions must die [Was: Reddit: why aren't people using D?]

Rainer Deyke rainerd at eldwood.com
Sat Jul 25 12:20:33 PDT 2009


Leandro Lucarella wrote:
> It has, providing tuples without that generally doesn't need language
> support, like D or C++ tuples. When you have multiple assignment, you can
> fully use the power of tuples, if not, it's just syntax sugar for structs,
> or some kind of limited list.

>From the Boost.Tuple documentation:

  int i; char c; double d;
  tie(i, c, d) = make_tuple(1,'a', 5.5);
  std::cout << i << " " <<  c << " " << d;

So C++ tuples *do* support multiple assignment, even without language
support.  Still not as nice as the Python syntax, though.


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list