From bbbf1ca0e4c44debcaa31d0b7dc361b5fcf077f0 Mon Sep 17 00:00:00 2001 From: Mingxin Wang Date: Fri, 25 Sep 2026 15:40:27 +0800 Subject: [PATCH] Drop the unused Nullable parameter of the conversion accessor cast_dispatch_base took a Nullable parameter so that the accessor of substitution_dispatch could convert an empty proxy to an empty proxy without invoking the dispatch. substitution_dispatch has been gone since #84, and both remaining users, implicit_conversion_dispatch and explicit_conversion_dispatch, pass false, so the branch it guarded was never instantiated. --- include/proxy/v5/detail/core.h | 7 +------ include/proxy/v5/detail/dispatch.h | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/proxy/v5/detail/core.h b/include/proxy/v5/detail/core.h index 0a25174..e2b7f67 100644 --- a/include/proxy/v5/detail/core.h +++ b/include/proxy/v5/detail/core.h @@ -1567,15 +1567,10 @@ struct converter { struct accessor { \ PRO5D_GEN_DEBUG_SYMBOL_FOR_MEM_ACCESSOR(operator T) \ explicit(Expl) operator T() oq ne { \ - if constexpr (Nullable) { \ - if (!static_cast(*this).has_value()) { \ - return nullptr; \ - } \ - } \ return invoke(static_cast

(*this)); \ } \ } -template +template struct cast_dispatch_base { PRO5D_DEF_ACCESSOR_TEMPLATE( MEM, PRO5D_DEF_CAST_ACCESSOR, diff --git a/include/proxy/v5/detail/dispatch.h b/include/proxy/v5/detail/dispatch.h index 98dc5c3..771676b 100644 --- a/include/proxy/v5/detail/dispatch.h +++ b/include/proxy/v5/detail/dispatch.h @@ -264,13 +264,13 @@ struct operator_dispatch<"[]", false> { #undef PRO5D_DEF_LHS_UNARY_OP_ACCESSOR #undef PRO5D_DEF_LHS_LEFT_OP_ACCESSOR -struct implicit_conversion_dispatch : detail::cast_dispatch_base { +struct implicit_conversion_dispatch : detail::cast_dispatch_base { template PRO5D_STATIC_CALL(T&&, T&& self) noexcept { return std::forward(self); } }; -struct explicit_conversion_dispatch : detail::cast_dispatch_base { +struct explicit_conversion_dispatch : detail::cast_dispatch_base { template PRO5D_STATIC_CALL(auto, T&& self) noexcept { return detail::converter{