Skip to content

Commit af54a10

Browse files
committed
Added auto_t
1 parent c13000e commit af54a10

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

provides/include/lax_v1/comparison.hpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@
44
#include "lax_v1/value.hpp"
55

66
template <class LhsExpr, class RhsExpr>
7-
struct lax_v1::gt_m
8-
: value_t<bool, ((value_of_v<LhsExpr>) > (value_of_v<RhsExpr>))> {};
7+
struct lax_v1::gt_m : auto_t<(value_of_v<LhsExpr>> value_of_v<RhsExpr>)> {};
98

109
template <class LhsExpr, class RhsExpr>
11-
struct lax_v1::gte_m
12-
: value_t<bool, ((value_of_v<LhsExpr>) >= (value_of_v<RhsExpr>))> {};
10+
struct lax_v1::gte_m : auto_t<(value_of_v<LhsExpr> >= value_of_v<RhsExpr>)> {};
1311

1412
template <class LhsExpr, class RhsExpr>
15-
struct lax_v1::lt_m
16-
: value_t<bool, ((value_of_v<LhsExpr>) < (value_of_v<RhsExpr>))> {};
13+
struct lax_v1::lt_m : auto_t<(value_of_v<LhsExpr> < value_of_v<RhsExpr>)> {};
1714

1815
template <class LhsExpr, class RhsExpr>
19-
struct lax_v1::lte_m
20-
: value_t<bool, ((value_of_v<LhsExpr>) <= (value_of_v<RhsExpr>))> {};
16+
struct lax_v1::lte_m : auto_t<(value_of_v<LhsExpr> <= value_of_v<RhsExpr>)> {};

provides/include/lax_v1/logical.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ template <> struct lax_v1::and_m<> : true_t {};
1818
template <class Expr, class... Exprs>
1919
struct lax_v1::and_m<Expr, Exprs...> : if_m<Expr, and_m<Exprs...>, false_t> {};
2020

21-
template <class Expr>
22-
struct lax_v1::not_m : value_t<bool, !value_of_v<Expr>> {};
21+
template <class Expr> struct lax_v1::not_m : auto_t<!value_of_v<Expr>> {};
2322

2423
template <> struct lax_v1::or_m<> : false_t {};
2524
template <class Expr, class... Exprs>

provides/include/lax_v1/value_synopsis.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ template <class Expr> using value_type_of_t = typename Expr::value_type;
1111
template <class Expr>
1212
inline constexpr value_type_of_t<Expr> value_of_v = Expr::value;
1313

14-
using true_t = value_t<bool, true>;
15-
using false_t = value_t<bool, false>;
14+
template <auto value> using auto_t = value_t<decltype(value), value>;
15+
16+
using true_t = auto_t<true>;
17+
using false_t = auto_t<false>;
1618

1719
} // namespace lax_v1

0 commit comments

Comments
 (0)