From e24f25ada7e8f48dc35cb235e045a4324bccb4f2 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 14 Feb 2015 10:43:49 +0100 Subject: Introduced `Eval` function evaluation helper * replaces `typename *::type` constructs with `Eval` applications * aims to further unify function evaluation --- example/prime/prime.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'example') diff --git a/example/prime/prime.cc b/example/prime/prime.cc index e89d2a4..b826a72 100644 --- a/example/prime/prime.cc +++ b/example/prime/prime.cc @@ -11,7 +11,7 @@ #include "runtime/list/for_each.h" // (define candidates (iota 1000 2 1)) -using candidates = tav::Iota, tav::Int<2>, tav::Int<1>>::type; +using candidates = tav::Eval, tav::Int<2>, tav::Int<1>>>; // (define (isMultipleOf candidate base) (= (modulo candidate base) 0)) template < @@ -42,15 +42,15 @@ using removeMultiplesOf = tav::Remove< // (car candidates))))))) template struct Sieve { - typedef typename tav::Cons< + typedef tav::Eval, - typename Sieve< - typename removeMultiplesOf< + tav::Eval, tav::Head - >::type - >::type - >::type type; + >> + >> + >> type; }; template <> @@ -59,7 +59,7 @@ struct Sieve { }; // (define primes (sieve candidates)) -using primes = Sieve::type; +using primes = tav::Eval>; int main(int, char **) { tav::runtime::for_each([](const int x) { -- cgit v1.2.3