From bdca992b95c34d51cbe27359c0161e6fa2d65c59 Mon Sep 17 00:00:00 2001 From: onihusube Date: Sun, 26 Jul 2020 01:25:12 +0900 Subject: [PATCH] =?UTF-8?q?map=E3=81=AE=E3=82=B3=E3=83=B3=E3=82=BB?= =?UTF-8?q?=E3=83=97=E3=83=88=E3=81=AE=E5=BC=95=E6=95=B0=E9=A0=86=E5=BA=8F?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/harmony.hpp | 14 +++++++------- test/harmony_test.cpp | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/harmony.hpp b/include/harmony.hpp index 2febfcb..71a78ba 100644 --- a/include/harmony.hpp +++ b/include/harmony.hpp @@ -701,7 +701,7 @@ namespace harmony::detail { [[no_unique_address]] F fmap; template - requires detail::map_reusable and + requires detail::map_reusable and not_void_resulted> friend constexpr specialization_of auto operator|(M&& m, map_impl self) noexcept(noexcept(std::forward(m).map(self.fmap))) { return monas(std::forward(m).map(self.fmap)); @@ -725,7 +725,7 @@ namespace harmony::detail { } template - requires (not detail::map_reusable) and + requires (not detail::map_reusable) and not_void_resulted> and either>>> friend constexpr specialization_of auto operator|(M&& m, map_impl self) { @@ -747,7 +747,7 @@ namespace harmony::detail { } template - requires (not detail::map_reusable) and + requires (not detail::map_reusable) and not_void_resulted> and (not either>>>) friend constexpr specialization_of auto operator|(M&& m, map_impl self) { @@ -886,7 +886,7 @@ namespace harmony::detail { [[no_unique_address]] F fmap; template - requires (not and_then_reusable) and + requires (not and_then_reusable) and std::invocable> and either>> and std::constructible_from>>, traits::unwrap_other_t> @@ -905,7 +905,7 @@ namespace harmony::detail { } template - requires and_then_reusable + requires and_then_reusable friend constexpr specialization_of auto operator|(M&& m, and_then_impl self) noexcept(noexcept(monas(std::forward(m).and_then(self.fmap)))) { return monas(std::forward(m).and_then(self.fmap)); } @@ -943,7 +943,7 @@ namespace harmony::detail { [[no_unique_address]] F fmap; template - requires (not or_else_reusable) and + requires (not or_else_reusable) and std::invocable> and either>> and std::constructible_from>>, traits::unwrap_t> @@ -962,7 +962,7 @@ namespace harmony::detail { } template - requires or_else_reusable + requires or_else_reusable friend constexpr specialization_of auto operator|(M&& m, or_else_impl self) noexcept(noexcept(monas(std::forward(m).or_else(self.fmap)))) { return monas(std::forward(m).or_else(self.fmap)); } diff --git a/test/harmony_test.cpp b/test/harmony_test.cpp index 1ffe7d9..9303000 100644 --- a/test/harmony_test.cpp +++ b/test/harmony_test.cpp @@ -373,6 +373,8 @@ int main() { 35_i == sum; } + +#ifndef _MSC_VER { using namespace std::string_view_literals; tl::expected ex{10}; @@ -387,6 +389,7 @@ int main() { ut::expect(harmony::validate(r)); "22.0"sv == harmony::unwrap(r); } +#endif // !_MSC_VER }; "map_err test"_test = [] {