Topic: Start of class scope


Author: rmaddox@isicns.com (Randy Maddox)
Date: Tue, 25 Jun 2002 21:35:40 GMT
Raw View
"Bo-Staffan Lankinen" <bo_steffan_lankinen@hotmail.com> wrote in message news:<af80t5$c66ou$1@ID-47792.news.dfncis.de>...
> Hello,
>
> I can't find the paragraph in the C++ standard that defines the start of the
> class scope. For instance, is the following legal?
>
> class Foo
> {
> protected:
>    class Bar {};
> };
>
> class FooBar : public Foo,public Foo::Bar
> {
> };

What an interesting question.  :-)  The MSVC++ compiler accepts your
snippet as is, and even allows me to declare an instance of class
FooBar.  IMHO, however, it should at least have complained that I was
publicly deriving from a protected class.  That is, class FooBar :
public Foo, protected Foo::Bar would seem the minimum that could be
correct.

What is it that you are trying to accomplish?

Randy.

>
> Bo-Staffan
>
>
> ---
> [ 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.jamesd.demon.co.uk/csc/faq.html                       ]

---
[ 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.jamesd.demon.co.uk/csc/faq.html                       ]





Author: "Bo-Staffan Lankinen" <bo_steffan_lankinen@hotmail.com>
Date: 24 Jun 2002 22:40:05 GMT
Raw View
Hello,

I can't find the paragraph in the C++ standard that defines the start of the
class scope. For instance, is the following legal?

class Foo
{
protected:
   class Bar {};
};

class FooBar : public Foo,public Foo::Bar
{
};

Bo-Staffan


---
[ 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.jamesd.demon.co.uk/csc/faq.html                       ]