Created
June 24, 2014 13:55
-
-
Save rigibun/1a46bab3c3a0f5abda4c to your computer and use it in GitHub Desktop.
Cons in Templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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