Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Super {};
- template<class T>
- class Base {
- public:
- T* getT() {
- return dynamic_cast<T*>(this);
- }
- virtual ~Base() {}
- };
- class Derived: public Base<Derived>, Super {
- };
- int main() {
- Derived derived {};
- derived.getT();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement