diff --git a/tl/expected.hpp b/tl/expected.hpp index f22d41b..3299750 100644 --- a/tl/expected.hpp +++ b/tl/expected.hpp @@ -1224,7 +1224,7 @@ public: /// \synopsis template \nconstexpr auto and_then(F &&f) &; template TL_EXPECTED_11_CONSTEXPR auto - and_then(F &&f) & -> decltype(and_then_impl(*this, std::forward(f))) { + and_then(F &&f) & -> decltype(and_then_impl(std::declval(), std::forward(f))) { return and_then_impl(*this, std::forward(f)); } @@ -1232,7 +1232,7 @@ public: /// \synopsis template \nconstexpr auto and_then(F &&f) &&; template TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) && -> decltype( - and_then_impl(std::move(*this), std::forward(f))) { + and_then_impl(std::declval(), std::forward(f))) { return and_then_impl(std::move(*this), std::forward(f)); } @@ -1240,7 +1240,7 @@ public: /// \synopsis template \nconstexpr auto and_then(F &&f) const &; template constexpr auto and_then(F &&f) const & -> decltype( - and_then_impl(*this, std::forward(f))) { + and_then_impl(std::declval(), std::forward(f))) { return and_then_impl(*this, std::forward(f)); } @@ -1249,7 +1249,7 @@ public: /// \synopsis template \nconstexpr auto and_then(F &&f) const &&; template constexpr auto and_then(F &&f) const && -> decltype( - and_then_impl(std::move(*this), std::forward(f))) { + and_then_impl(std::declval(), std::forward(f))) { return and_then_impl(std::move(*this), std::forward(f)); } #endif