OS Manuals

memory.hpp(3)

memory.hpp - Support for types found in <memory>.

memory.hpp(3) Library Functions Manual memory.hpp(3)

memory.hpp - Support for types found in <memory>.

#include 'cereal/cereal.hpp'
#include <memory>
#include <cstring>
#include 'cereal/types/polymorphic.hpp'


struct cereal::memory_detail::PtrWrapper< T >
A wrapper class to notify cereal that it is ok to serialize the contained pointer. struct cereal::memory_detail::LoadAndConstructLoadWrapper< Archive, T >
A struct that acts as a wrapper around calling load_andor_construct. class cereal::memory_detail::EnableSharedStateHelper< T >


template<class T> PtrWrapper< T > cereal::memory_detail::make_ptr_wrapper (T &&t)
Make a PtrWrapper. template<class Archive, class T> void cereal::memory_detail::loadAndConstructSharedPtr (Archive &ar, T *ptr, std::true_type)
template<class Archive, class T> void cereal::memory_detail::loadAndConstructSharedPtr (Archive &ar, T *ptr, std::false_type)
template<class Archive, class T> std::enable_if<!std::is_polymorphic< T >::value, void >::type cereal::CEREAL_SAVE_FUNCTION_NAME (Archive &ar, std::shared_ptr< T > const &ptr)
Saving std::shared_ptr for non polymorphic types. template<class Archive, class T> std::enable_if<!std::is_polymorphic< T >::value, void >::type cereal::CEREAL_LOAD_FUNCTION_NAME (Archive &ar, std::shared_ptr< T > &ptr)
Loading std::shared_ptr, case when no user load and construct for non polymorphic types. template<class Archive, class T> std::enable_if<!std::is_polymorphic< T >::value, void >::type cereal::CEREAL_SAVE_FUNCTION_NAME (Archive &ar, std::weak_ptr< T > const &ptr)
Saving std::weak_ptr for non polymorphic types. template<class Archive, class T> std::enable_if<!std::is_polymorphic< T >::value, void >::type cereal::CEREAL_LOAD_FUNCTION_NAME (Archive &ar, std::weak_ptr< T > &ptr)
Loading std::weak_ptr for non polymorphic types. template<class Archive, class T, class D> std::enable_if<!std::is_polymorphic< T >::value, void >::type cereal::CEREAL_SAVE_FUNCTION_NAME (Archive &ar, std::unique_ptr< T, D > const &ptr)
Saving std::unique_ptr for non polymorphic types. template<class Archive, class T, class D> std::enable_if<!std::is_polymorphic< T >::value, void >::type cereal::CEREAL_LOAD_FUNCTION_NAME (Archive &ar, std::unique_ptr< T, D > &ptr)
Loading std::unique_ptr, case when user provides load_and_construct for non polymorphic types. template<class Archive, class T> void cereal::CEREAL_SAVE_FUNCTION_NAME (Archive &ar, memory_detail::PtrWrapper< std::shared_ptr< T > const & > const &wrapper)
Saving std::shared_ptr (wrapper implementation). template<class Archive, class T> std::enable_if< traits::has_load_and_construct< T, Archive >::value, void >::type cereal::CEREAL_LOAD_FUNCTION_NAME (Archive &ar, memory_detail::PtrWrapper< std::shared_ptr< T > & > &wrapper)
Loading std::shared_ptr, case when user load and construct (wrapper implementation). template<class Archive, class T> std::enable_if<!traits::has_load_and_construct< T, Archive >::value, void >::type cereal::CEREAL_LOAD_FUNCTION_NAME (Archive &ar, memory_detail::PtrWrapper< std::shared_ptr< T > & > &wrapper)
Loading std::shared_ptr, case when no user load and construct (wrapper implementation). template<class Archive, class T, class D> void cereal::CEREAL_SAVE_FUNCTION_NAME (Archive &ar, memory_detail::PtrWrapper< std::unique_ptr< T, D > const & > const &wrapper)
Saving std::unique_ptr (wrapper implementation). template<class Archive, class T, class D> std::enable_if< traits::has_load_and_construct< T, Archive >::value, void >::type cereal::CEREAL_LOAD_FUNCTION_NAME (Archive &ar, memory_detail::PtrWrapper< std::unique_ptr< T, D > & > &wrapper)
Loading std::unique_ptr, case when user provides load_and_construct (wrapper implementation). template<class Archive, class T, class D> std::enable_if<!traits::has_load_and_construct< T, Archive >::value, void >::type cereal::CEREAL_LOAD_FUNCTION_NAME (Archive &ar, memory_detail::PtrWrapper< std::unique_ptr< T, D > & > &wrapper)
Loading std::unique_ptr, case when no load_and_construct (wrapper implementation).

Support for types found in <memory>.

Performs loading and construction for a shared pointer that is NOT derived from std::enable_shared_from_this

This is the typical case, where we simply pass the load wrapper to the archive.

Parameters

ar The archive
ptr Raw pointer held by the shared_ptr

Performs loading and construction for a shared pointer that is derived from std::enable_shared_from_this

Parameters

ar The archive
ptr Raw pointer held by the shared_ptr

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