aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-05 13:54:01 +0100
committerAdrian Kummerlaender2015-02-05 13:54:01 +0100
commitd546e0d1172ee138971ced523a97121b495a7ba1 (patch)
tree7df5115a3843ffc7de09a1cddf5c204f56d809d1 /example
parent7eef405eeff59c27691be294906e8381a76771e2 (diff)
downloadTypeAsValue-d546e0d1172ee138971ced523a97121b495a7ba1.tar
TypeAsValue-d546e0d1172ee138971ced523a97121b495a7ba1.tar.gz
TypeAsValue-d546e0d1172ee138971ced523a97121b495a7ba1.tar.bz2
TypeAsValue-d546e0d1172ee138971ced523a97121b495a7ba1.tar.lz
TypeAsValue-d546e0d1172ee138971ced523a97121b495a7ba1.tar.xz
TypeAsValue-d546e0d1172ee138971ced523a97121b495a7ba1.tar.zst
TypeAsValue-d546e0d1172ee138971ced523a97121b495a7ba1.zip
Reimplemented `removeMultiplesOf` in terms of a partial function application
Diffstat (limited to 'example')
-rw-r--r--example/prime/prime.cc15
1 files changed, 4 insertions, 11 deletions
diff --git a/example/prime/prime.cc b/example/prime/prime.cc
index 9d10ff4..93b7db5 100644
--- a/example/prime/prime.cc
+++ b/example/prime/prime.cc
@@ -24,17 +24,10 @@ template <
typename Candidates,
typename Base
>
-class removeMultiplesOf {
- private:
- template <typename Element>
- using predicate_wrapper = isMultipleOf<Element, Base>;
-
- public:
- typedef typename tav::Remove<
- predicate_wrapper,
- Candidates
- >::type type;
-};
+using removeMultiplesOf = tav::Remove<
+ tav::Apply<isMultipleOf, tav::_0, Base>::template single_type,
+ Candidates
+>;
template <typename Candidates>
struct Sieve {