join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::details::VariantHelper< Ts > Struct Template Reference

helper class for variant operations using jump tables for O(1) dispatch. More...

#include <variant.hpp>

Static Public Member Functions

static void copy (std::size_t which, const void *src, void *dst)
 copy one object to another.
 
static void move (std::size_t which, void *src, void *dst)
 move one object to another.
 
static void destroy (std::size_t which, void *data)
 destroy the currently active object.
 
static bool equal (std::size_t which, const void *a, const void *b)
 compare if two objects of the same alternative are equal.
 
template<typename Ordering >
static Ordering compare (std::size_t which, const void *a, const void *b)
 three-way compare two objects of the same alternative.
 

Detailed Description

template<typename... Ts>
struct join::details::VariantHelper< Ts >

helper class for variant operations using jump tables for O(1) dispatch.

Member Function Documentation

◆ compare()

template<typename... Ts>
template<typename Ordering >
static Ordering join::details::VariantHelper< Ts >::compare ( std::size_t which,
const void * a,
const void * b )
inlinestatic

three-way compare two objects of the same alternative.

Parameters
whichinternal storage index of the active alternative.
afirst storage pointer.
bsecond storage pointer.
Returns
ordering of a relative to b.

◆ copy()

template<typename... Ts>
static void join::details::VariantHelper< Ts >::copy ( std::size_t which,
const void * src,
void * dst )
inlinestatic

copy one object to another.

Parameters
whichinternal storage index of the active alternative.
srcsource storage pointer.
dstdestination storage pointer.

◆ destroy()

template<typename... Ts>
static void join::details::VariantHelper< Ts >::destroy ( std::size_t which,
void * data )
inlinestatic

destroy the currently active object.

Parameters
whichinternal storage index of the active alternative.
datastorage pointer.

◆ equal()

template<typename... Ts>
static bool join::details::VariantHelper< Ts >::equal ( std::size_t which,
const void * a,
const void * b )
inlinestatic

compare if two objects of the same alternative are equal.

Parameters
whichinternal storage index of the active alternative.
afirst storage pointer.
bsecond storage pointer.
Returns
true if equal, false otherwise.

◆ move()

template<typename... Ts>
static void join::details::VariantHelper< Ts >::move ( std::size_t which,
void * src,
void * dst )
inlinestatic

move one object to another.

Parameters
whichinternal storage index of the active alternative.
srcsource storage pointer.
dstdestination storage pointer.

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