diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-19 15:18:02 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-19 15:18:02 +0100 |
commit | 67760d797c7dac09077e59a87fa3c27a610a5fc4 (patch) | |
tree | 62d2c53bf5a5f3935bbfc059ba49dbe5b1c6e29d /test | |
parent | 17ee71b537bf65923acc021a1ed382ab76df9f98 (diff) |
entity: make `constantly` more generic
Diffstat (limited to 'test')
-rw-r--r-- | test/entity.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/entity.cpp b/test/entity.cpp index d09c94ba..4e0935f2 100644 --- a/test/entity.cpp +++ b/test/entity.cpp @@ -189,10 +189,12 @@ constexpr bool test_names() constexpr void test_range() { constexpr auto x = TestAccessors{}; - constexpr auto foo = entity::type<int>::field{"foo"_s, &TestAccessors::foo, &TestAccessors::foo, - constantly<TestAccessors, constraints::length{42}>, - constantly<TestAccessors, constraints::range<int>{37, 42}>, - [](const TestAccessors&) constexpr -> constraints::group { return "foo"_s; }}; + constexpr auto foo = entity::type<int>::field{ + "foo"_s, &TestAccessors::foo, &TestAccessors::foo, + constantly<TestAccessors>(constraints::length{42}), + constantly<TestAccessors>(constraints::range<int>{37, 42}), + constantly<TestAccessors>(constraints::group{"foo"_s}) + }; using limits = std::numeric_limits<int>; |