From 2b5eb30cd4af30186e21ed6cccde7e6208a4ce4e Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Thu, 14 Nov 2019 10:53:32 +0100 Subject: [PATCH] P1813 compilation errors fixed --- src/include/units/bits/numeric_concepts.h | 63 +++++++++++------------ 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/src/include/units/bits/numeric_concepts.h b/src/include/units/bits/numeric_concepts.h index 7dafc99e..7575cca8 100644 --- a/src/include/units/bits/numeric_concepts.h +++ b/src/include/units/bits/numeric_concepts.h @@ -63,7 +63,7 @@ namespace std { }; template - using two_sided_identity_t = decltype(two_sided_identity{}(declval(), declval(), declval())); + using two_sided_identity_t = decltype(two_sided_identity()); template struct left_zero {}; @@ -100,13 +100,13 @@ namespace std { }; template - using two_sided_zero_t = decltype(two_sided_zero{}(declval(), declval(), declval())); + using two_sided_zero_t = decltype(two_sided_zero()); template struct inverse_traits {}; template - using inverse_operation_t = typename inverse_traits::type; + using inverse_operation_t = typename inverse_traits::type; template concept commutative_operation = @@ -138,9 +138,9 @@ namespace std { template concept quasigroup = magma && requires { - typename inverse_operation_t; - typename inverse_operation_t, T, U>; - requires same_as, T, U>>; + typename inverse_operation_t; + typename inverse_operation_t>; + requires same_as>>; }; template @@ -173,8 +173,8 @@ namespace std { template concept summable_with = // exposition only - default_initializable> && - default_initializable> && + default_constructible> && + default_constructible> && common_reference_with && requires(T&& t, U&& u) { { std::forward(t) + std::forward(t) } -> common_with; @@ -277,15 +277,15 @@ namespace std { template concept divisible_with = // exposition only - multiplicable_with && - subtractible_with && + multiplicable_with && + differenceable_with && requires(T&& t, U&& u) { { std::forward(t) / std::forward(t) } -> common_with; { std::forward(u) / std::forward(u) } -> common_with; { std::forward(t) / std::forward(u) } -> common_with; { std::forward(u) / std::forward(t) } -> common_with; requires same_as(t) / std::forward(u)), - decltype(std::forward(u) / std::forward(t))>;; + decltype(std::forward(u) / std::forward(t))>; }; } @@ -322,20 +322,19 @@ namespace std { template requires magma - struct left_identity { + struct left_identity { constexpr common_type_t operator()() const { return T{}; } }; template requires magma - struct right_identity { + struct right_identity { constexpr common_type_t operator()() const { return U{}; } }; template<> struct inverse_traits { - using type = minus; - + using type = ranges::minus; constexpr type operator()() const noexcept { return type{}; } }; @@ -348,53 +347,53 @@ namespace std { struct inverse_traits { using type = ranges::plus; constexpr type operator()() const noexcept { return type{}; } - } + }; template - requires magma - struct left_identity { + requires magma + struct left_identity { constexpr common_type_t operator()() const { return T{1}; } }; template - requires magma - struct right_identity { + requires magma + struct right_identity { constexpr common_type_t operator()() const { return U{1}; } }; template - requires magma - struct left_zero { + requires magma + struct left_zero { constexpr common_type_t operator()() const { return T{}; } }; template - requires magma - struct right_zero { + requires magma + struct right_zero { constexpr common_type_t operator()() const { return U{}; } }; template<> - struct inverse_traits { - using type = divided_by; + struct inverse_traits { + using type = ranges::divided_by; constexpr type operator()() const noexcept { return type{}; } }; template - requires magma - struct right_identity { + requires magma + struct right_identity { constexpr common_type_t operator()() const { return U{1}; } }; template<> - struct inverse_traits { - using type = times; + struct inverse_traits { + using type = ranges::times; constexpr type operator()() const noexcept { return type{}; } }; template - requires magma - struct left_zero { + requires magma + struct left_zero { constexpr common_type_t operator()() const { return T{}; } };