Lumiera  0.pre.03
»edit your freedom«
Holder< TYPES > Struct Template Reference

#include "lib/variant-o.hpp"

Description

template<typename TYPES>
struct lib::variant::Holder< TYPES >

internal helper used to build a variant storage wrapper.

Parametrised with a collection of types, it provides functionality to copy a value of one of these types into an internal buffer, while remembering which of these types was used to place this copy. The value can be later on extracted using a visitation like mechanism, which takes a functor class and invokes a function access(T&) with the type matching the current value in storage

Definition at line 80 of file variant-o.hpp.

Public Types

enum  {
  TYPECNT = count<TYPES>::value,
  SIZE = maxSize<TYPES>::value
}
 
typedef InstantiateWithIndex< TYPES, PlacementAdapter, BufferStorage
 

Static Public Member Functions

template<class FUNCTOR >
static FUNCTOR::Ret access (Buffer &buf)
 access the variant's inline buffer, using the configured access functor. More...
 

Classes

struct  Buffer
 Storage to hold the actual value. More...
 
struct  CasePrepare
 initialise the dispatcher (trampoline) for the case of accessing type T More...
 
struct  CaseSelect
 provide a dispatcher table based visitation mechanism More...
 
struct  Deleter
 
struct  PlacementAdapter
 

Member Function Documentation

◆ access()

static FUNCTOR::Ret access ( Buffer buf)
inlinestatic

access the variant's inline buffer, using the configured access functor.

Note
the actual accessor instance is created on demand (static)
Todo:
shouldn't this rather be located within the Holder::Storage created by clients??

Definition at line 190 of file variant-o.hpp.

+ Collaboration diagram for Holder< TYPES >:

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