Topic: nested classes in template (syntax)


Author: miniussi@labri.u-bordeaux.fr (Alain MINIUSSI)
Date: 1995/07/28
Raw View
I like to declare nested classes this way :

in A.h :

class A {
  public:
    class B;
  public:
    A();
 etc....
};

in A_B.h:

class A::B {
  public:
    B();
   ~B();
  etc...
};

in A_B.cc :

A::B::B() : etc...

what is the correct syntax if A is a template class ?

--
*=================================================================*
    Miniussi Alain                tel: (33) 56-84-69-08
    LaBRI                         fax: (33) 56-84-66-69
    Univ. BORDEAUX I
    351, cours de la Liberation
    33405 TALENCE
    FRANCE                    e-mail:miniussi@labri.u-bordeaux.fr
*=================================================================*





Author: miniussi@labri.u-bordeaux.fr (Alain MINIUSSI)
Date: 1995/07/28
Raw View
In article <3vb4rr$2h3@serveur.cribx1.u-bordeaux.fr>, miniussi@labri.u-bordeaux.fr (Alain MINIUSSI) writes:
|> I like to declare nested classes this way :
|>
|> in A.h :
|>
|> class A {
|>   public:
|>     class B;
|>   public:
|>     A();
|>  etc....
|> };
|>
|> in A_B.h:
|>
|> class A::B {
|>   public:
|>     B();
|>    ~B();
|>   etc...
|> };
|>
|> in A_B.cc :
|>
|> A::B::B() : etc...
|>
|> what is the correct syntax if A is a template class ?

the other question is:
  - does the standard allow that kind of stuff and, if not
(my compiler says no) : why ?

--
*=================================================================*
    Miniussi Alain                tel: (33) 56-84-69-08
    LaBRI                         fax: (33) 56-84-66-69
    Univ. BORDEAUX I
    351, cours de la Liberation
    33405 TALENCE
    FRANCE                    e-mail:miniussi@labri.u-bordeaux.fr
*=================================================================*