cereal::detail::OutputBindingCreator&lt; Archive, T &gt;(3) Library Functions Manual cereal::detail::OutputBindingCreator&lt; Archive, T &gt;(3)

# [NAME](#NAME)

cereal::detail::OutputBindingCreator&lt; Archive, T &gt; - Creates a binding (map entry) between an output archive type and a polymorphic type.

# [SYNOPSIS](#SYNOPSIS)

#include &lt;/home/build/include/cereal/details/polymorphic\_impl.hpp&gt;

## [Classes](#Classes)

class **PolymorphicSharedPointerWrapper**  
Holds a properly typed shared\_ptr to the polymorphic type.

## [Public Member Functions](#Public_Member_Functions)

**OutputBindingCreator** ()  
Initialize the binding.

## [Static Public Member Functions](#Static_Public_Member_Functions)

static void **writeMetadata** (Archive &ar)  
Writes appropriate metadata to the archive for this polymorphic type. static void **savePolymorphicSharedPtr** (Archive &ar, T const \*dptr, std::true\_type)  
Does the actual work of saving a polymorphic shared\_ptr. static void **savePolymorphicSharedPtr** (Archive &ar, T const \*dptr, std::false\_type)  
Does the actual work of saving a polymorphic shared\_ptr.

# [Detailed Description](#Detailed_Description)

## [template&lt;class Archive, class T&gt;](#template_class_Archive,_class_T_)

struct cereal::detail::OutputBindingCreator&lt; Archive, T &gt;"Creates a binding (map entry) between an output archive type and a polymorphic type.

Bindings are made when types are registered, assuming that at least one archive has already been registered. When this struct is created, it will insert (at run time) an entry into a map that properly handles casting for serializing polymorphic objects

# [Member Function Documentation](#Member_Function_Documentation)

## template&lt;class Archive, class T&gt; void **cereal::detail::OutputBindingCreator**&lt; Archive, T &gt;::savePolymorphicSharedPtr (Archive & ar, T const * dptr, std::false\_type ) \[inline], \[static]

Does the actual work of saving a polymorphic shared\_ptr. This function will properly create a shared\_ptr from the void * that is passed in before passing it to the archive for serialization.

This version is for types that do not inherit from std::enable\_shared\_from\_this.

**Parameters**

*ar* The archive to serialize to  
*dptr* Pointer to the actual data held by the shared\_ptr

## template&lt;class Archive, class T&gt; void **cereal::detail::OutputBindingCreator**&lt; Archive, T &gt;::savePolymorphicSharedPtr (Archive & ar, T const * dptr, std::true\_type ) \[inline], \[static]

Does the actual work of saving a polymorphic shared\_ptr. This function will properly create a shared\_ptr from the void * that is passed in before passing it to the archive for serialization.

In addition, this will also preserve the state of any internal enable\_shared\_from\_this mechanisms

**Parameters**

*ar* The archive to serialize to  
*dptr* Pointer to the actual data held by the shared\_ptr

# [Author](#Author)

Generated automatically by Doxygen for cereal from the source code.

Mon Oct 26 2026 02:55:37 cereal

---

Document: cereal_detail_OutputBindingCreator(3) from cereal 1.3.2-r7 (Chainguard OS)
Source: https://github.com/USCiLab/cereal
