cereal::OutputArchive&lt; ArchiveType, Flags &gt;(3) Library Functions Manual cereal::OutputArchive&lt; ArchiveType, Flags &gt;(3)

# [NAME](#NAME)

cereal::OutputArchive&lt; ArchiveType, Flags &gt; - The base output archive class.

# [SYNOPSIS](#SYNOPSIS)

#include &lt;/home/build/include/cereal/cereal.hpp&gt;

Inherits **cereal::detail::OutputArchiveBase**.

## [Public Member Functions](#Public_Member_Functions)

**OutputArchive** (ArchiveType \*const derived)  
Construct the output archive. **OutputArchive** & **operator=** (**OutputArchive** const &)=delete  
template&lt;class ... Types&gt; ArchiveType & **operator()** (Types &&... args)  
Serializes all passed in data. void **serializeDeferments** ()  
Serializes any data marked for deferment using defer. std::uint32\_t **registerSharedPointer** (const std::shared\_ptr&lt; const void &gt; &sharedPointer)  
Registers a shared pointer with the archive. std::uint32\_t **registerPolymorphicType** (char const \*name)  
Registers a polymorphic type name with the archive.

Public Member Functions inherited from **cereal::detail::OutputArchiveBase**  
**OutputArchiveBase** (OutputArchiveBase &&) **CEREAL\_NOEXCEPT**  
OutputArchiveBase & **operator=** (OutputArchiveBase &&) **CEREAL\_NOEXCEPT**

## [Boost Transition Layer](#Boost_Transition_Layer)

Functionality that mirrors the syntax for Boost. This is useful if you are transitioning a large project from Boost to cereal. The preferred interface for cereal is using operator().  
using **is\_loading** = std::false\_type  
Indicates this archive is not intended for loading. using **is\_saving** = std::true\_type  
Indicates this archive is intended for saving. template&lt;class T&gt; ArchiveType & **operator&** (T &&arg)  
Serializes passed in data. template&lt;class T&gt; ArchiveType & **operator&lt;&lt;** (T &&arg)  
Serializes passed in data.

# [Detailed Description](#Detailed_Description)

## [template&lt;class ArchiveType, std::uint32\_t Flags = 0&gt;](#template_class_ArchiveType,_std::uint32_t_Flags_=_0_)

class cereal::OutputArchive&lt; ArchiveType, Flags &gt;"The base output archive class.

This is the base output archive for all output archives. If you create a custom archive class, it should derive from this, passing itself as a template parameter for the ArchiveType.

The base class provides all of the functionality necessary to properly forward data to the correct serialization functions.

Individual archives should use a combination of prologue and epilogue functions together with specializations of serialize, save, and load to alter the functionality of their serialization.

**Template Parameters**

*ArchiveType* The archive type that derives from **OutputArchive**  
*Flags Flags to control advanced functionality. See the Flags enum for more information.*

# [Member Typedef Documentation](#Member_Typedef_Documentation)

## template&lt;class ArchiveType, std::uint32\_t Flags = 0&gt; using **cereal::OutputArchive**&lt; ArchiveType, **Flags** &gt;::is\_loading = std::false\_type

Indicates this archive is not intended for loading. This ensures compatibility with boost archive types. If you are transitioning from boost, you can check this value within a member or external serialize function (i.e., Archive::is\_loading::value) to disable behavior specific to loading, until you can transition to split save/load or save\_minimal/load\_minimal functions

## template&lt;class ArchiveType, std::uint32\_t Flags = 0&gt; using **cereal::OutputArchive**&lt; ArchiveType, **Flags** &gt;::is\_saving = std::true\_type

Indicates this archive is intended for saving. This ensures compatibility with boost archive types. If you are transitioning from boost, you can check this value within a member or external serialize function (i.e., Archive::is\_saving::value) to enable behavior specific to loading, until you can transition to split save/load or save\_minimal/load\_minimal functions

# [Constructor & Destructor Documentation](#Constructor_&_Destructor_Documentation)

## [template&lt;class ArchiveType, std::uint32\_t Flags = 0&gt; **cereal::OutputArchive**&lt; ArchiveType, **Flags** &gt;::OutputArchive (ArchiveType \*const derived) \[inline\]](#template_class_ArchiveType,_std::uint32_t_Flags_=_0__)

Construct the output archive.

**Parameters**

*derived* A pointer to the derived ArchiveType (pass this from the derived archive)

# [Member Function Documentation](#Member_Function_Documentation)

## template&lt;class ArchiveType, std::uint32\_t Flags = 0&gt; template&lt;class T&gt; ArchiveType & **cereal::OutputArchive**&lt; ArchiveType, **Flags** &gt;::operator& (T && arg) \[inline]

Serializes passed in data. This is a boost compatability layer and is not the preferred way of using cereal. If you are transitioning from boost, use this until you can transition to the operator() overload

## [template&lt;class ArchiveType, std::uint32\_t Flags = 0&gt; template&lt;class ... Types&gt; ArchiveType & **cereal::OutputArchive**&lt; ArchiveType, **Flags** &gt;::operator() (Types &&... args) \[inline\]](#template_class_ArchiveType,_std::uint32_t_Flags_=_0__template_class_)

Serializes all passed in data. This is the primary interface for serializing data with an archive

## template&lt;class ArchiveType, std::uint32\_t Flags = 0&gt; template&lt;class T&gt; ArchiveType & **cereal::OutputArchive**&lt; ArchiveType, **Flags** &gt;::operator&lt;&lt; (T && arg) \[inline]

Serializes passed in data. This is a boost compatability layer and is not the preferred way of using cereal. If you are transitioning from boost, use this until you can transition to the operator() overload

## template&lt;class ArchiveType, std::uint32\_t Flags = 0&gt; std::uint32\_t **cereal::OutputArchive**&lt; ArchiveType, **Flags** &gt;::registerPolymorphicType (char const * name) \[inline]

Registers a polymorphic type name with the archive. This function is used to track polymorphic types to prevent unnecessary saves of identifying strings used by the polymorphic support functionality.

## template&lt;class ArchiveType, std::uint32\_t Flags = 0&gt; std::uint32\_t **cereal::OutputArchive**&lt; ArchiveType, **Flags** &gt;::registerSharedPointer (const std::shared\_ptr&lt; const void &gt; & sharedPointer) \[inline]

Registers a shared pointer with the archive. This function is used to track shared pointer targets to prevent unnecessary saves from taking place if multiple shared pointers point to the same data.

## [template&lt;class ArchiveType, std::uint32\_t Flags = 0&gt; void **cereal::OutputArchive**&lt; ArchiveType, **Flags** &gt;::serializeDeferments () \[inline\]](#template_class_ArchiveType,_std::uint32_t_Flags_=_0__void_)

Serializes any data marked for deferment using defer. This will cause any data wrapped in **DeferredData** to be immediately serialized

# [Author](#Author)

Generated automatically by Doxygen for cereal from the source code.

Mon Oct 26 2026 20:39:03 cereal

---

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