variant
A type safe generalized union type
List of all members
variant_storage< Args > Class Template Reference

A templated generalized union. More...

#include <variant_storage.hpp>

Detailed Description

template<class... Args>
class variant_storage< Args >

A templated generalized union.

Warning
The user must manually call the destructor of the active member

Represents the storage for a variant. Use a generalized union to automatically take care of alignment issues.

Provides a free function get to obtain the i-th element, acts like std::get(tuple). Notice that this class is very limited by its own nature, it can not support direct asssignment (only assignment to a specific sub element). It supports in place construction, by passing a std::integral_constant tag to specify the actual type that the user wants to construct.

For maximum genericity, having the same type multiple times in the parameter list is allowed, but the user has still to take care to access the type through the same index.

This class is meant to be used only by variant, users must be extremely careful to use this class copy constructor, assignment operator and destructor.


The documentation for this class was generated from the following file: