From 87f67efc60635b3753e87f4bbb4cd58e4eea778e Mon Sep 17 00:00:00 2001 From: Jean-Louis Leroy Date: Mon, 10 Mar 2025 14:36:36 -0400 Subject: [PATCH] virtual_shared_ptr: fix static/dynamic cast detection --- include/boost/openmethod/shared_ptr.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/openmethod/shared_ptr.hpp b/include/boost/openmethod/shared_ptr.hpp index c758c5c..06c23ba 100644 --- a/include/boost/openmethod/shared_ptr.hpp +++ b/include/boost/openmethod/shared_ptr.hpp @@ -103,7 +103,8 @@ struct virtual_traits, Policy> { check_cast(); - if constexpr (detail::requires_dynamic_cast) { + if constexpr (detail::requires_dynamic_cast< + Class*, typename Other::element_type*>) { return std::dynamic_pointer_cast< typename shared_ptr_traits::virtual_type>(obj); } else {