From -4577184978265841157
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,64c04ae5e5b49e61,start
X-Google-Attributes: gidf78e5,public
From: Beszedes Arpad <beszedes@cc.u-szeged.hu>
Subject: class-definition using a qualified-name
Date: 2000/04/20
Message-ID: <38FD77E7.F3F90217@cc.u-szeged.hu>#1/1
X-Deja-AN: 613351675
Content-Transfer-Encoding: 7bit
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
X-Accept-Language: en
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Trace: mail2news.demon.co.uk 956186166 mail2news:10007 mail2news mail2news.demon.co.uk
Organization: RGAI
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Mime-Version: 1.0
NNTP-Posting-Date: 19 Apr 2000 08:11:23 GMT
Newsgroups: comp.std.c++

Hi List,
I cannot find anywhere in the standard if the following is legal or not:

class outer
{
public:
  class inner;
};

class other_class
{
  class outer::inner
  {
  public:
    int i;
  };

  // ...

};

int main()
{
  outer::inner a;
  a.i = 2;
  return 0;
}

I.e. can be a class defined outside of its "real" container scope
(namely in an another namespace- or class-scope)?

(Btw my compiler -- MSVC6 -- compiles the above code).


Thanks,
  Arpad.

-- 
***********************************************
*  Arpad Beszedes (research engineer)         *
*                                             *
*  Research Group on Artificial Intelligence  *
*  Hungarian Academy of Sciences              *
*  Attila Jozsef University, Szeged, Hungary  *
*  e-mail: beszedes@cc.u-szeged.hu            *
*  tel.: (+36) 62/544-145                     *
***********************************************
* "To err is human, but to really mess things *
*          up you need a computer."           *
***********************************************

---
[ 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              ]




