Skip to content

Instantly share code, notes, and snippets.

@rigibun
Created June 24, 2014 13:55
Show Gist options
  • Save rigibun/1a46bab3c3a0f5abda4c to your computer and use it in GitHub Desktop.
Save rigibun/1a46bab3c3a0f5abda4c to your computer and use it in GitHub Desktop.
Cons in Templates
struct CONS(T, U)
{
alias T car;
alias U cdr;
}
unittest
{
alias CONS!(int, CONS!(double, bool)) X;
assert(is(X.car == int));
assert(is(X.cdr.cdr == bool));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment