cereal::BinaryData&lt; T &gt;(3) Library Functions Manual cereal::BinaryData&lt; T &gt;(3)

# [NAME](#NAME)

cereal::BinaryData&lt; T &gt; - A wrapper around data that can be serialized in a binary fashion.

# [SYNOPSIS](#SYNOPSIS)

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

## [Public Types](#Public_Types)

using **PT**

## [Public Member Functions](#Public_Member_Functions)

**BinaryData** (T &&d, uint64\_t s)

## [Public Attributes](#Public_Attributes)

**PT** **data**  
pointer to beginning of data uint64\_t **size**  
size in bytes

## [Related Symbols](#Related_Symbols)

(Note that these are not member symbols.)  
template&lt;class T&gt; BinaryData&lt; T &gt; **binary\_data** (T &&data, size\_t size)  
Convenience function to create binary data for both const and non const pointers.

# [Detailed Description](#Detailed_Description)

## [template&lt;class T&gt;](#template_class_T_)

struct cereal::BinaryData&lt; T &gt;"A wrapper around data that can be serialized in a binary fashion.

This class is used to demarcate data that can safely be serialized as a binary chunk of data. Individual archives can then choose how best represent this during serialization.

# [Member Typedef Documentation](#Member_Typedef_Documentation)

## [template&lt;class T&gt; using **cereal::BinaryData**&lt; T &gt;::PT](#template_class_T__using_)

**Initial value:**

```
typename std::conditional<std::is_const<typename std::remove_pointer<typename std::remove_reference<T>::type>::type>::value,


                                        const void *,


                                        void *>::type
```

```

```

Internally store the pointer as a void \*, keeping const if created with a const pointer

# [Author](#Author)

Generated automatically by Doxygen for cereal from the source code.

Sat Oct 10 2026 08:08:15 cereal

---

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