template <class T, class U> class SomeClass { public: // ... U some_method() { // ... }}class OtherClass : public SomeClass<YetAnotherClass, OtherClass> { // !!! public: // ...}
template <class T, class U> class Image { public: // ... U cropping(int x, int y, uint width, uint height) { // ... } // ... protected: std::vector<std::vector<T> > grid;}class Surface : public Image<Tile, Surface> { // ...}class Layer : public Image<MapFeature, Layer> { // ...}