cereal::detail::PolymorphicVirtualCaster&lt; Base, Derived &gt;(3) Library Functions Manual cereal::detail::PolymorphicVirtualCaster&lt; Base, Derived &gt;(3)

# [NAME](#NAME)

cereal::detail::PolymorphicVirtualCaster&lt; Base, Derived &gt; - Strongly typed derivation of **PolymorphicCaster**.

# [SYNOPSIS](#SYNOPSIS)

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

Inherits **cereal::detail::PolymorphicCaster**.

## [Public Member Functions](#Public_Member_Functions)

**PolymorphicVirtualCaster** ()  
Inserts an entry in the polymorphic casting map for this pairing. void const * **downcast** (void const \*const ptr) const override  
Performs the proper downcast with the templated types. void * **upcast** (void \*const ptr) const override  
Performs the proper upcast with the templated types. std::shared\_ptr&lt; void &gt; **upcast** (std::shared\_ptr&lt; void &gt; const &ptr) const override  
Performs the proper upcast with the templated types (shared\_ptr version).

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

# [Detailed Description](#Detailed_Description)

## [template&lt;class Base, class Derived&gt;](#template_class_Base,_class_Derived_)

struct cereal::detail::PolymorphicVirtualCaster&lt; Base, Derived &gt;"Strongly typed derivation of **PolymorphicCaster**.

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

## [template&lt;class Base, class Derived&gt; **cereal::detail::PolymorphicVirtualCaster**&lt; Base, Derived &gt;::PolymorphicVirtualCaster () \[inline\]](#template_class_Base,_class_Derived__)

Inserts an entry in the polymorphic casting map for this pairing. Creates an explicit mapping between Base and Derived in both upwards and downwards directions, allowing void pointers to either to be properly cast assuming dynamic type information is available

# [Member Function Documentation](#Member_Function_Documentation)

## [template&lt;class Base, class Derived&gt; void const * **cereal::detail::PolymorphicVirtualCaster**&lt; Base, Derived &gt;::downcast (void const \*const ptr) const \[inline\], \[override\], \[virtual\]](#template_class_Base,_class_Derived__void_const__*_)

Performs the proper downcast with the templated types.

Implements **cereal::detail::PolymorphicCaster**.

## [template&lt;class Base, class Derived&gt; std::shared\_ptr&lt; void &gt; **cereal::detail::PolymorphicVirtualCaster**&lt; Base, Derived &gt;::upcast (std::shared\_ptr&lt; void &gt; const & ptr) const \[inline\], \[override\], \[virtual\]](#template_class_Base,_class_Derived__std::shared_ptr__void___)

Performs the proper upcast with the templated types (shared\_ptr version).

Implements **cereal::detail::PolymorphicCaster**.

## [template&lt;class Base, class Derived&gt; void * **cereal::detail::PolymorphicVirtualCaster**&lt; Base, Derived &gt;::upcast (void \*const ptr) const \[inline\], \[override\], \[virtual\]](#template_class_Base,_class_Derived__void_*_)

Performs the proper upcast with the templated types.

Implements **cereal::detail::PolymorphicCaster**.

# [Author](#Author)

Generated automatically by Doxygen for cereal from the source code.

Sat Aug 29 2026 00:42:30 cereal

---

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