From 96d547c03d2feab8db64c53c3744a9b4a7c8f2c5 Mon Sep 17 00:00:00 2001 From: bobble-clank <85295933+bobble-clank@users.noreply.github.com> Date: Tue, 7 Sep 2021 19:23:16 +1000 Subject: [PATCH] Fix use of std::remove_cv in static_assert (#90) Access result via the member type 'type'. Otherwise the static_assert does not do as was intended. --- include/tl/expected.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/tl/expected.hpp b/include/tl/expected.hpp index 31a5193..31b130a 100644 --- a/include/tl/expected.hpp +++ b/include/tl/expected.hpp @@ -1216,11 +1216,11 @@ class expected : private detail::expected_move_assign_base, private detail::expected_delete_assign_base, private detail::expected_default_ctor_base { static_assert(!std::is_reference::value, "T must not be a reference"); - static_assert(!std::is_same>::value, + static_assert(!std::is_same::type>::value, "T must not be in_place_t"); - static_assert(!std::is_same>::value, + static_assert(!std::is_same::type>::value, "T must not be unexpect_t"); - static_assert(!std::is_same>>::value, + static_assert(!std::is_same>::type>::value, "T must not be unexpected"); static_assert(!std::is_reference::value, "E must not be a reference");