Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct Nil {};
- template <typename H, typename T>
- class Cons : public T {
- protected:
- typedef T BaseType;
- H mVal;
- };
- class Foo : public Cons<int, Cons<char*, Cons<bool, Nil> > >
- {
- Foo() {
- mVal = 2;
- BaseType::mVal = "asdf";
- BaseType::BaseType::mVal = false;
- }
- };
Add Comment
Please, Sign In to add comment