MaximCherchuk

C templates in action

Jul 22nd, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. class A {};
  6. class B {};
  7.  
  8. template<typename ...base>
  9. class C : base... {
  10. public:
  11.     C(base&&... base_classes) : base(base_classes)... {}
  12. };
  13.  
  14. int main(int argc, char** argv) {
  15.     C<A, B> smth(A(), B());
  16. }
Advertisement
Add Comment
Please, Sign In to add comment