inline-ness of private nested class

it seems that I cannot define a method of an inner nested class if it is a private class. for example:

1
2
3
4
5
6
7
8
9
10
11

class outter {
    class nested {
      void foo ( void ) {} // okay - but is this inline?
    }

    void inner::foo( void ) {} // not okay - cannot define inside another class
}

void outter::inner::foo( void ) {} // not okay - 'nested' class is private!


what I want to know is, is there another way to define an inner class's method? and if not, is it eternally doomed to be inline because it has to be declared inside it's own class declaration?
1)

1
2
3
4
5
class outter {
    class nested {
      void foo ( void ) {} // yes, it is inline
    };
};


2)

1
2
3
4
5
6
7
class outter {
    class nested {
      void foo ( void );    
    };
};

inline void outter::nested::foo( void ) {} // and it is also inline 
void outter::inner::foo( void ) {} // not okay - 'nested' class is private!

This code here is not only perfectly legal, but is how you do it. Whether or not the function is private or not does not matter.
@Disch
void outter::inner::foo( void ) {} // not okay - 'nested' class is private!

This code here is not only perfectly legal, but is how you do it. Whether or not the function is private or not does not matter.


This code is invalid because name inner is not defined and the corresponding declaration in class outer is wrong.:)
woops, I'm not sure what happened, it seems I must have had some other syntactical error.

thanks.
vlad: I figured it was a typo. =P
Topic archived. No new replies allowed.