Last active
March 11, 2016 09:45
-
-
Save milesrout/58a57b809e50efec214f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
using cons = struct { | |
template <typename car> | |
struct value { | |
struct type { | |
template <typename cdr> | |
using of = cons_literal<car, cdr>; | |
}; | |
}; | |
template <typename car> | |
using of = typename value<car>::type; | |
}; | |
using TERNARY_FUNCTION = struct { | |
template <typename PARAM1> | |
struct value { | |
struct type { | |
template <typename PARAM2> | |
struct value { | |
struct type { | |
template <typename PARAM3> | |
using of = RESULT; | |
}; | |
}; | |
template <typename PARAM2> | |
using of = typename value<PARAM2>::type; | |
}; | |
}; | |
template <typename PARAM1> | |
using of = typename value<PARAM1>::type; | |
}; | |
int main() | |
{ | |
using std::cout; using std::endl; | |
cout << string_literal<'a', 'b', 'c', '\n', '\0'>{}; | |
cout << integer_literal<5000>{} << endl; | |
using one = integer_literal<1>; | |
using two = integer_literal<2>; | |
using three = integer_literal<3>; | |
cout << cons::of<three>::of<nil_literal>>>{} << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment