aboutsummaryrefslogtreecommitdiff
path: root/src/conditional
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-15 14:07:50 +0100
committerAdrian Kummerlaender2015-02-15 14:07:50 +0100
commit46e174935b122c0da4b51532a7f683a512eeaf65 (patch)
tree88bed0d869ce40c460e6370b4954ff159fe3c575 /src/conditional
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 'src/conditional')
-rw-r--r--src/conditional/cond.h19
-rw-r--r--src/conditional/if.h4
2 files changed, 15 insertions, 8 deletions
diff --git a/src/conditional/cond.h b/src/conditional/cond.h
index 2d6a415..f6b7965 100644
--- a/src/conditional/cond.h
+++ b/src/conditional/cond.h
@@ -8,22 +8,29 @@
namespace tav {
+namespace detail {
+
template <typename... Branches>
class Cond {
private:
template <typename Pair>
- using predicate = IsTrue<Eval<Eval<Car<Pair>>>>;
+ using predicate = IsTrue<tav::Car<Pair>>;
public:
- typedef Eval<Cdr<
- Eval<Find<
+ typedef tav::Cdr<
+ tav::Find<
predicate,
- Eval<List<Branches...>>
- >>
- >> type;
+ tav::List<Branches...>
+ >
+ > type;
};
}
+template <typename... Branches>
+using Cond = Eval<detail::Cond<Branches...>>;
+
+}
+
#endif // TYPEASVALUE_SRC_CONDITIONAL_COND_H_
diff --git a/src/conditional/if.h b/src/conditional/if.h
index b99f399..9be1a50 100644
--- a/src/conditional/if.h
+++ b/src/conditional/if.h
@@ -10,11 +10,11 @@ template <
typename TrueBranch,
typename FalseBranch
>
-using If = std::conditional<
+using If = Eval<std::conditional<
Condition::value,
TrueBranch,
FalseBranch
->;
+>>;
}