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.
 
static bool lower (std::size_t which, const void *a, const void *b)
 compare if one object is lower than another 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

◆ 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.

◆ lower()

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

compare if one object is lower than another of the same alternative.

Parameters
whichinternal storage index of the active alternative.
afirst storage pointer.
bsecond storage pointer.
Returns
true if a is lower than b, 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: