سؤال

Let's say we got class A and method B... The correct Syntax is return type A::B() {...}

Now imagine, we have a class B inside the class A and plus method C that has the inner class B (proxy class due to [ ][ ] operator) as a "return type". How do I do that?

A::B A::B::C() {} does not work neither does B A::B::C() {}

Plus I'd like to have it in .cpp and .h file.

هل كانت مفيدة؟

المحلول

It looks like you're referring to the wrong scope for your operator[]. Perhaps you meant:

CScreen::Proxy CScreen::operator[] (int index) const 
{
  return Proxy ( m_playground, index, m_y );
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top