Topic: C++0x wish: injection into unions


Author: "Al Grant" <tnarga@arm.REVERSE-NAME.com>
Date: Mon, 4 Jun 2001 20:01:06 GMT
Raw View
I would like to see automatic injection into unions, for
assignment and initialisation.  E.g.

  union { T *t; S *s; } typedef U;

  U f(T *t) { return t; }

The rule for selecting which member to inject into would
be precisely the rule used to select from a set of
overloaded functions, with one for each available type.



---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]