cereal::MapItem&lt; Key, Value &gt;(3) Library Functions Manual cereal::MapItem&lt; Key, Value &gt;(3)

# [NAME](#NAME)

cereal::MapItem&lt; Key, Value &gt; - A wrapper around a key and value for serializing data into maps.

# [SYNOPSIS](#SYNOPSIS)

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

## [Public Types](#Public_Types)

using **KeyType**  
using **ValueType**

## [Public Member Functions](#Public_Member_Functions)

**MapItem** (Key &&key\_, Value &&value\_)  
Construct a **MapItem** from a key and a value. **MapItem** & **operator=** (**MapItem** const &)=delete  
template&lt;class Archive&gt; void **CEREAL\_SERIALIZE\_FUNCTION\_NAME** (Archive &archive)  
Serialize the **MapItem** with the NVPs *key"*and*value*.

## [Public Attributes](#Public_Attributes)

KeyType **key**  
ValueType **value**

# [Detailed Description](#Detailed_Description)

## [template&lt;class Key, class Value&gt;](#template_class_Key,_class_Value_)

struct cereal::MapItem&lt; Key, Value &gt;"A wrapper around a key and value for serializing data into maps.

This class just provides a grouping of keys and values into a struct for human readable archives. For example, XML archives will use this wrapper to write maps like so:

```
<mymap>


  <item0>


    <key>MyFirstKey</key>


    <value>MyFirstValue</value>


  </item0>


  <item1>


    <key>MySecondKey</key>


    <value>MySecondValue</value>


  </item1>
</mymap>
```

**See also**

**make\_map\_item**

# [Member Typedef Documentation](#Member_Typedef_Documentation)

## template&lt;class Key, class Value&gt; using **cereal::MapItem**&lt; Key, Value &gt;::KeyType

**Initial value:**

```
typename std::conditional<


     std::is_lvalue_reference<Key>::value,


     Key,


     typename std::decay<Key>::type>::type
```

```

```

## template&lt;class Key, class Value&gt; using **cereal::MapItem**&lt; Key, Value &gt;::ValueType

**Initial value:**

```
typename std::conditional<


     std::is_lvalue_reference<Value>::value,


     Value,


     typename std::decay<Value>::type>::type
```

```

```

# [Author](#Author)

Generated automatically by Doxygen for cereal from the source code.

Mon Oct 26 2026 02:55:37 cereal

---

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