Skip to content

Instantly share code, notes, and snippets.

@benjamn
Created December 2, 2008 01:16
Show Gist options
  • Save benjamn/30931 to your computer and use it in GitHub Desktop.
Save benjamn/30931 to your computer and use it in GitHub Desktop.
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;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment