Guest User

Untitled

a guest
Feb 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. typedef struct Nil {};
  2.  
  3. template <typename H, typename T>
  4. class Cons : public T {
  5. protected:
  6. typedef T BaseType;
  7. H mVal;
  8. };
  9.  
  10. class Foo : public Cons<int, Cons<char*, Cons<bool, Nil> > >
  11. {
  12. Foo() {
  13. mVal = 2;
  14. BaseType::mVal = "asdf";
  15. BaseType::BaseType::mVal = false;
  16. }
  17. };
Add Comment
Please, Sign In to add comment