Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!ukc!stl!servax0!sersun1!whisd From: whisd@sersun1.essex.ac.uk (Whiteside S D B) Newsgroups: comp.lang.c++ Subject: C++ Nested Classes Message-ID: <5263@servax0.essex.ac.uk> Date: 5 Jun 91 17:27:18 GMT Sender: news@servax0.essex.ac.uk Reply-To: whisd@essex.ac.uk (Whiteside S D B) Organization: University of Essex, Colchester, UK Lines: 26 It lets me nest a class within another, but... i) If the class is named, then I can access the class outside the enclosing class (or inside it, if I assign a variable to the class declaration). This seems odd. The nested declaration has not "hidden" the class name. My main worry here is that this implies that the nested class name needs to be unique throughout the whole name space. ii)If I declare an unnamed class, that's acceptable. But then I can't access the class definition to define my member functions! Without the naming I can't get my scope modifier :: to work, but with it, my nested class joins the big bad global world of classes, with no protection! It's hard to see a way around this. It there a theoretical reason why C++ is set up this way? Is it a remnant of "globalish" C or am I just confused? Comments please. Simon Whiteside