aboutsummaryrefslogtreecommitdiff
path: root/src/conditional
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-19 19:18:48 +0100
committerAdrian Kummerlaender2015-02-19 19:18:48 +0100
commita07999f7436802f15fc21bebd083006c9e681638 (patch)
tree0292012d7f0cc721e6f4a33a7253dbd3373ea551 /src/conditional
parent1528d3cc919031d04a2d140a35d9b4cff6633eba (diff)
downloadTypeAsValue-a07999f7436802f15fc21bebd083006c9e681638.tar
TypeAsValue-a07999f7436802f15fc21bebd083006c9e681638.tar.gz
TypeAsValue-a07999f7436802f15fc21bebd083006c9e681638.tar.bz2
TypeAsValue-a07999f7436802f15fc21bebd083006c9e681638.tar.lz
TypeAsValue-a07999f7436802f15fc21bebd083006c9e681638.tar.xz
TypeAsValue-a07999f7436802f15fc21bebd083006c9e681638.tar.zst
TypeAsValue-a07999f7436802f15fc21bebd083006c9e681638.zip
Introduced `Branch` and `Else` pair aliases for usage in `Cond`
* pure _syntax sugar_ to improve readability of `Cond` conditionals
Diffstat (limited to 'src/conditional')
-rw-r--r--src/conditional/cond.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/conditional/cond.h b/src/conditional/cond.h
index c543449..5f8014f 100644
--- a/src/conditional/cond.h
+++ b/src/conditional/cond.h
@@ -19,6 +19,15 @@ using Cond = Cdr<Eval<
detail::find_variadic<detail::cond_predicate, Branches...>
>>;
+template <
+ typename Condition,
+ typename Result
+>
+using Branch = Pair<Condition, Result>;
+
+template <typename Result>
+using Else = Branch<Boolean<true>, Result>;
+
}
#endif // TYPEASVALUE_SRC_CONDITIONAL_COND_H_