OS Manuals

cereal_detail_OutputBindingCreator_PolymorphicSharedPointerWrapper(3)

cereal::detail::OutputBindingCreator< Archive, T >::PolymorphicSharedPointerWrapper - Holds a properly typed shared_ptr to the polymorphic type.

cereal::detail::OutputBindingCreator< Archive, T >::PolymorphicSharedPointerWrapper(3) Library Functions Manual cereal::detail::OutputBindingCreator< Archive, T >::PolymorphicSharedPointerWrapper(3)

cereal::detail::OutputBindingCreator< Archive, T >::PolymorphicSharedPointerWrapper - Holds a properly typed shared_ptr to the polymorphic type.

#include </home/build/include/cereal/details/polymorphic_impl.hpp>


PolymorphicSharedPointerWrapper (T const *dptr)
std::shared_ptr< T const > const & operator() () const
Get the wrapped shared_ptr */.

class cereal::detail::OutputBindingCreator< Archive, T >::PolymorphicSharedPointerWrapper"Holds a properly typed shared_ptr to the polymorphic type.

Wrap a raw polymorphic pointer in a shared_ptr to its true type

The wrapped pointer will not be responsible for ownership of the held pointer so it will not attempt to destroy it; instead the refcount of the wrapped pointer will be tied to a fake 'ownership pointer' that will do nothing when it ultimately goes out of scope.

The main reason for doing this, other than not to destroy the true object with our wrapper pointer, is to avoid meddling with the internal reference count in a polymorphic type that inherits from std::enable_shared_from_this.

Parameters

dptr A void pointer to the contents of the shared_ptr to serialize

Generated automatically by Doxygen for cereal from the source code.

Sat Oct 10 2026 08:08:15 cereal

cereal 1.3.2-r6 · enterprise-packages · ingested 2026-10-10