
On Fri, 13 Feb 2004 17:54:41 -0500, David Abrahams <dave@boost-consulting.com> wrote:
"Giovanni Bajo" <giovannibajo@libero.it> writes:
struct A { typedef int M;
template <class M> void foo(void) { M m; // which M is this? } };
I know the C++ committe is discussing this issue at this moment. The argument would be that "M" names the typedef because it's "more stable" than the template parameter (which could get renamed in an out-of-class definition). See also http://gcc.gnu.org/PR13967 for a detailed discussion.
I'm sorry, but that's insane from a usability POV.
Yeah. These aren't certainly the kind of rules that make we sleep peacefully :( BTW, template parameters are among the things which get more easily hidden in C++ - see 14.6.1/5 and 14.6.1/7. Daveed Vandevoorde is collecting opinions on this (and replies are a plebiscite) http://google.com/groups?threadm=52f2f9cd.0402031816.5fb1e8a0%40posting.goog... Do you know why? Is he proposing some change in the CWG? Genny.