diff --git a/include/cereal/details/traits.hpp b/include/cereal/details/traits.hpp index ff16db38..ec1c1984 100644 --- a/include/cereal/details/traits.hpp +++ b/include/cereal/details/traits.hpp @@ -558,10 +558,12 @@ namespace cereal }; } + //! Determine if T or any base class of T has inherited from std::enable_shared_from_this template struct has_shared_from_this : decltype(detail::shared_from_this_wrapper::check(std::declval>())) { }; + //! Get the type of the base class of T which inherited from std::enable_shared_from_this template struct get_shared_from_this_base { @@ -569,6 +571,7 @@ namespace cereal using sftw = detail::shared_from_this_wrapper; using PtrType = decltype(sftw::get(std::declval())); public: + //! The type of the base of T that inherited from std::enable_shared_from_this using type = typename std::decay::type; }; @@ -621,8 +624,6 @@ namespace cereal } }; } // namespace detail - - } // namespace cereal #endif // CEREAL_DETAILS_TRAITS_HPP_