struct base {};

class outer: public base
{
  private:
    enum { some=42, special=67, implementation=999, details=-13 };

  public:
    struct inner 
    { 
      protected: 
        void foo() { int can_usethis = special + implementation + details; } 
    };

    outer() : _inner() { }

    void call_inner(inner& i) const 
    { 
        //i.foo(); // fails (protected)
    }

    void call_inner() const 
    { 
        //_inner.foo(); // fails (protected)
    }

  private:
    inner _inner;
};


int main()
{
    outer o;
    outer::inner i;

    // i.foo(); // fails: protected
    o.call_inner(i);
}
