From bee57b4cb737982e4e7623149ce65d38bbc2c2e3 Mon Sep 17 00:00:00 2001 From: Dmitry Arkhipov Date: Fri, 30 Jun 2023 14:33:43 +0300 Subject: [PATCH] remove unnecessary code in value_to for variant --- include/boost/json/detail/value_to.hpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/boost/json/detail/value_to.hpp b/include/boost/json/detail/value_to.hpp index 4bdb3ca3..6e178bab 100644 --- a/include/boost/json/detail/value_to.hpp +++ b/include/boost/json/detail/value_to.hpp @@ -873,14 +873,10 @@ tag_invoke( using T = std::variant_alternative_t; auto attempt = try_value_to(jv, ctx); - if( attempt ) + if( attempt) res.emplace(std::in_place_index_t(), std::move(*attempt)); }); - if( res.has_error() ) - { - res = {system::in_place_error, ec}; - } return res; } #endif // BOOST_NO_CXX17_HDR_VARIANT