From da1f12b81b39ea3d5b552ef1dbd16c2188f6e175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Alexandre=20Boissonneault?= Date: Sun, 3 Dec 2017 22:11:12 -0500 Subject: [PATCH] Fixed missing decay in make_unexpected (ex: const lvalue expressions would create unexpected, which would not compile) --- expected.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/expected.hpp b/expected.hpp index c9fe9a6..2a3442d 100644 --- a/expected.hpp +++ b/expected.hpp @@ -158,8 +158,8 @@ constexpr bool operator>=(const unexpected &lhs, const unexpected &rhs) { /// *Example:* /// auto e1 = tl::make_unexpected(42); /// unexpected e2 (42); //same semantics -template unexpected make_unexpected(E &&e) { - return unexpected(std::forward(e)); +template unexpected::type> make_unexpected(E &&e) { + return unexpected::type>(std::forward(e)); } /// \brief A tag type to tell expected to construct the unexpected value