Skip to content

Commit 3fca8aa

Browse files
committed
Redesigned lazify
1 parent ac2f761 commit 3fca8aa

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

provides/include/lax_v1/lazify.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,3 @@
22

33
#include "lax_v1/type.hpp"
44
#include "lax_v1/value.hpp"
5-
6-
template <template <class... Formals> class Trait, class... Actuals>
7-
struct lax_v1::lazify_t : type_t<type_of_t<Trait<type_of_t<Actuals>...>>> {};
8-
9-
template <class Type, template <class... Formals> class Trait, class... Actuals>
10-
struct lax_v1::lazify_v
11-
: value_t<Type, value_of_v<Trait<type_of_t<Actuals>...>>> {};

provides/include/lax_v1/synopsis.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ template <class Expr> struct not_m;
5656
// lazify.hpp ==================================================================
5757

5858
template <template <class... Formals> class Trait, class... Actuals>
59-
struct lazify_t;
59+
using lazify_type_trait_t = type_t<type_of_t<Trait<type_of_t<Actuals>...>>>;
6060

6161
template <class Type, template <class... Formals> class Trait, class... Actuals>
62-
struct lazify_v;
62+
using lazify_value_trait_t =
63+
value_t<Type, value_of_v<Trait<type_of_t<Actuals>...>>>;
6364

6465
// type_traits.hpp =============================================================
6566

provides/include/lax_v1/type_traits.hpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,25 @@
66
#include <type_traits>
77

88
template <class TypeExpr>
9-
struct lax_v1::alignment_of_m : lazify_v<size_t, std::alignment_of, TypeExpr> {
10-
};
9+
struct lax_v1::alignment_of_m
10+
: lazify_value_trait_t<size_t, std::alignment_of, TypeExpr> {};
1111

1212
template <class TypeExpr>
13-
struct lax_v1::is_array_m : lazify_v<bool, std::is_array, TypeExpr> {};
13+
struct lax_v1::is_array_m
14+
: lazify_value_trait_t<bool, std::is_array, TypeExpr> {};
1415

1516
template <class TypeExpr>
16-
struct lax_v1::is_pointer_m : lazify_v<bool, std::is_pointer, TypeExpr> {};
17+
struct lax_v1::is_pointer_m
18+
: lazify_value_trait_t<bool, std::is_pointer, TypeExpr> {};
1719

1820
template <class LhsTypeExpr, class RhsTypeExpr>
1921
struct lax_v1::is_same_m
20-
: lazify_v<bool, std::is_same, LhsTypeExpr, RhsTypeExpr> {};
22+
: lazify_value_trait_t<bool, std::is_same, LhsTypeExpr, RhsTypeExpr> {};
2123

2224
template <class TypeExpr>
2325
struct lax_v1::remove_all_extents_m
24-
: lazify_t<std::remove_all_extents, TypeExpr> {};
26+
: lazify_type_trait_t<std::remove_all_extents, TypeExpr> {};
2527

2628
template <class TypeExpr>
27-
struct lax_v1::remove_pointer_m : lazify_t<std::remove_pointer, TypeExpr> {};
29+
struct lax_v1::remove_pointer_m
30+
: lazify_type_trait_t<std::remove_pointer, TypeExpr> {};

0 commit comments

Comments
 (0)