aboutsummaryrefslogtreecommitdiff
path: root/src/conditional
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-14 10:43:49 +0100
committerAdrian Kummerlaender2015-02-14 10:43:49 +0100
commite24f25ada7e8f48dc35cb235e045a4324bccb4f2 (patch)
tree3b6c409c7d336557163dcb25e4b11fdef82a3a79 /src/conditional
parent73680466149c7aad21de558b7acc11dfa05183d2 (diff)
downloadTypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.tar
TypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.tar.gz
TypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.tar.bz2
TypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.tar.lz
TypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.tar.xz
TypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.tar.zst
TypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.zip
Introduced `Eval` function evaluation helper
* replaces `typename *::type` constructs with `Eval` applications * aims to further unify function evaluation
Diffstat (limited to 'src/conditional')
-rw-r--r--src/conditional/cond.h12
-rw-r--r--src/conditional/if.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/conditional/cond.h b/src/conditional/cond.h
index 0c2b1a8..2d6a415 100644
--- a/src/conditional/cond.h
+++ b/src/conditional/cond.h
@@ -12,15 +12,15 @@ template <typename... Branches>
class Cond {
private:
template <typename Pair>
- using predicate = IsTrue<typename Car<Pair>::type::type>;
+ using predicate = IsTrue<Eval<Eval<Car<Pair>>>>;
public:
- typedef typename Cdr<
- typename Find<
+ typedef Eval<Cdr<
+ Eval<Find<
predicate,
- typename List<Branches...>::type
- >::type
- >::type type;
+ Eval<List<Branches...>>
+ >>
+ >> type;
};
diff --git a/src/conditional/if.h b/src/conditional/if.h
index b019674..b99f399 100644
--- a/src/conditional/if.h
+++ b/src/conditional/if.h
@@ -6,12 +6,12 @@
namespace tav {
template <
- bool Condition,
+ typename Condition,
typename TrueBranch,
typename FalseBranch
>
using If = std::conditional<
- Condition,
+ Condition::value,
TrueBranch,
FalseBranch
>;