fork download
  1. template <template <typename> class Derived, typename T>
  2. class Base{
  3. public:
  4. Derived<T> processing(){
  5. return *static_cast<Derived<T> *>(this);
  6. }
  7. };
  8.  
  9. template <typename T>
  10. class Derived : public Base<Derived, T> {
  11. };
  12.  
  13. int main() {
  14. Derived<int> derived1;
  15. Derived<int> derived2 = derived1.processing();
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty