aboutsummaryrefslogtreecommitdiff
path: root/src/conditional
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-15 22:37:06 +0100
committerAdrian Kummerlaender2015-02-15 22:37:06 +0100
commita59df7e8c4fd1f88bc1078ebcfde944502b0c309 (patch)
tree5e5ecdf040a8b5fdebff55ec489a03ffea38501f /src/conditional
parent8e49cc6f8f2186ef028bfa765fd06e52ce5218c5 (diff)
downloadTypeAsValue-a59df7e8c4fd1f88bc1078ebcfde944502b0c309.tar
TypeAsValue-a59df7e8c4fd1f88bc1078ebcfde944502b0c309.tar.gz
TypeAsValue-a59df7e8c4fd1f88bc1078ebcfde944502b0c309.tar.bz2
TypeAsValue-a59df7e8c4fd1f88bc1078ebcfde944502b0c309.tar.lz
TypeAsValue-a59df7e8c4fd1f88bc1078ebcfde944502b0c309.tar.xz
TypeAsValue-a59df7e8c4fd1f88bc1078ebcfde944502b0c309.tar.zst
TypeAsValue-a59df7e8c4fd1f88bc1078ebcfde944502b0c309.zip
Simplified `Cond`, `Cons` and `Map` implementations
* continuation of 8e49cc6f8f
Diffstat (limited to 'src/conditional')
-rw-r--r--src/conditional/cond.h24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/conditional/cond.h b/src/conditional/cond.h
index f6b7965..eeb31b6 100644
--- a/src/conditional/cond.h
+++ b/src/conditional/cond.h
@@ -10,26 +10,18 @@ namespace tav {
namespace detail {
-template <typename... Branches>
-class Cond {
- private:
- template <typename Pair>
- using predicate = IsTrue<tav::Car<Pair>>;
-
- public:
- typedef tav::Cdr<
- tav::Find<
- predicate,
- tav::List<Branches...>
- >
- > type;
-
-};
+template <typename Pair>
+using cond_predicate = IsTrue<Car<Pair>>;
}
template <typename... Branches>
-using Cond = Eval<detail::Cond<Branches...>>;
+using Cond = Cdr<
+ Find<
+ detail::cond_predicate,
+ List<Branches...>
+ >
+>;
}