aboutsummaryrefslogtreecommitdiff
path: root/example/prime
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-15 14:07:50 +0100
committerAdrian Kummerlaender2015-02-15 14:07:50 +0100
commit46e174935b122c0da4b51532a7f683a512eeaf65 (patch)
tree88bed0d869ce40c460e6370b4954ff159fe3c575 /example/prime
parente24f25ada7e8f48dc35cb235e045a4324bccb4f2 (diff)
downloadTypeAsValue-46e174935b122c0da4b51532a7f683a512eeaf65.tar
TypeAsValue-46e174935b122c0da4b51532a7f683a512eeaf65.tar.gz
TypeAsValue-46e174935b122c0da4b51532a7f683a512eeaf65.tar.bz2
TypeAsValue-46e174935b122c0da4b51532a7f683a512eeaf65.tar.lz
TypeAsValue-46e174935b122c0da4b51532a7f683a512eeaf65.tar.xz
TypeAsValue-46e174935b122c0da4b51532a7f683a512eeaf65.tar.zst
TypeAsValue-46e174935b122c0da4b51532a7f683a512eeaf65.zip
Moved class-based implementations into `detail` namespace
* while class templates enable e.g. hiding implementation details they also require evaluation via `Eval` ** this clutters up the actual logic and is now hidden behind aliae that perform the evaluation
Diffstat (limited to 'example/prime')
-rw-r--r--example/prime/prime.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/example/prime/prime.cc b/example/prime/prime.cc
index b826a72..cd119d8 100644
--- a/example/prime/prime.cc
+++ b/example/prime/prime.cc
@@ -5,13 +5,13 @@
#include "function/apply.h"
#include "list/list.h"
-#include "list/operation/higher/filter.h"
#include "list/generator/iota.h"
+#include "list/operation/higher/remove.h"
#include "runtime/list/for_each.h"
// (define candidates (iota 1000 2 1))
-using candidates = tav::Eval<tav::Iota<tav::Size<1000>, tav::Int<2>, tav::Int<1>>>;
+using candidates = tav::Iota<tav::Size<1000>, 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 <typename Candidates>
struct Sieve {
- typedef tav::Eval<tav::Cons<
+ typedef tav::Cons<
tav::Head<Candidates>,
tav::Eval<Sieve<
- tav::Eval<removeMultiplesOf<
+ removeMultiplesOf<
tav::Tail<Candidates>,
tav::Head<Candidates>
- >>
+ >
>>
- >> type;
+ > type;
};
template <>