You can not create objects of type SomeInterface::reference
, since it is a pure abstract class, and that is what the compiler told you.
You need to return a reference (or a pointer) to such class. Like this :
virtual reference& operator[](unsigned int pos) = 0;
but then :
- in derived classes, you shouldn't change the signature of the pure virtual methods. It should stay
virtual SomeInterface::reference& operator[](unsigned int pos)
- you can not return reference to a temporary object
btw take care how you create objects of such classes. They do not have virtual destructors.