RPNX::DataStructures
Header-only C++ data structures and supporting utilities.
Loading...
Searching...
No Matches
rpnx::variant_detail< Allocator > Class Template Reference

Allocator-aware erased operations used by basic_variant. More...

#include <variant.hpp>

Classes

class  is_supported_variant
 
class  is_supported_variant< basic_variant< Allocator2, Ts... > >
 
struct  variant_info
 Erased operation table for a single variant alternative. More...
 

Public Types

using default_new_func = void* (*)(Allocator&)
 Allocates and default-constructs one erased alternative.
 
using copy_func = void* (*)(Allocator&, void const*)
 Allocates and copy-constructs one erased alternative.
 
using delete_func = void (*)(Allocator&, void*) noexcept
 Destroys and deallocates one erased alternative.
 
using less_func = bool (*)(void const*, void const*)
 Less-than comparison operation for one alternative type.
 
using equals_func = bool (*)(void const*, void const*)
 Equality comparison operation for one alternative type.
 
using three_way_func = std::strong_ordering (*)(void const*, void const*)
 Strong three-way comparison operation for one alternative type.
 
using new_move_from_func = void* (*)(Allocator&, void*)
 Allocates an alternative by moving from erased storage.
 

Static Public Member Functions

template<typename T>
static constexpr variant_info make_variant_info ()
 Builds the erased operation table for an alternative.
 

Detailed Description

template<typename Allocator>
class rpnx::variant_detail< Allocator >

Allocator-aware erased operations used by basic_variant.

The table produced by this class records allocation, lifetime, type, and comparison operations for one alternative. It is exposed so template instantiations can share metadata; applications normally use basic_variant rather than this implementation support type.

Template Parameters
AllocatorAllocator carried by the associated variant.

Member Function Documentation

◆ make_variant_info()

template<typename Allocator>
template<typename T>
static constexpr variant_info rpnx::variant_detail< Allocator >::make_variant_info ( )
inlinestaticconstexpr

Builds the erased operation table for an alternative.

Template Parameters
TAlternative type represented by the table.
Returns
Operation table whose entries act on T objects.

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