Topic: Implicit typedef of a class type in class


Author: "Vlad Harchev" <vladhar@imimail.ssau.ru>
Date: 1998/09/04
Raw View
CD2 says, that in each class there must be a typedef with the name of that
class, that denotes the type of that class. Is the following code legal?

struct s
{
  typedef int type;

  typedef s::s::s::s::type type1;    /* (1) is this OK ? */
};

/*  now reference it from outside */
typedef s::s::s::s::type type1;      /* (2) is this OK ? */


As I remember, it was successfully compiled by GCC 2.7.2.
Borland C++ 5.02, as I remember, allowed only (1). May be I am wrong about
BCC.





[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: James Kuyper <kuyper@wizard.net>
Date: 1998/09/04
Raw View
Vlad Harchev wrote:
>
> CD2 says, that in each class there must be a typedef with the name of that
> class, that denotes the type of that class.

Citation please?


[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]