Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<int n> struct Const {};
- ...
- // compile Arg2 = getArg 1
- template<>
- struct Compile<Arg2> : GetArg<1> {};
- ...
- template<class L, class R>
- struct Compile<Times<L, R> > {
- int operator()(Args args)
- {
- return Bind<Compile<L>, Bind<Compile<R>, Return> > (
- Compile<L>(),
- [](int left) -> Bind<Compile<R>, Return> {
- return Bind<Compile<R>, Return>(
- Compile<R>(),
- [left](int right) -> Return {
- return Return(left * right);
- }
- );
- }
- )(args);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement