Skip to content

Class state_holder

class state_holder<T, Stateless> base

template <typename T, bool Stateless>
struct state_holder

Holds a state value, either by ownership or by reference, depending on the Stateless template parameter.

Template parameters
T The state value type. Must not be const-qualified.
Stateless When false, the holder owns a copy of the state. When true, the holder stores a (non-owning) pointer to an externally owned state object.

Fully qualified name: kfr::state_holder<T, Stateless>

Class state_holder

class state_holder<T, false> base

template <typename T>
struct state_holder<T, false> { … }

Owning specialization of state_holder .

constructor state_holder<T, false>()

constexpr state_holder()                    = delete

Fully qualified name: kfr::state_holder<T, false>::state_holder<T, false>()

constructor state_holder<T, false>(const state_holder<T, false> &)

constexpr state_holder(const state_holder&) = default

Fully qualified name: kfr::state_holder<T, false>::state_holder<T, false>(const state_holder<T, false> &)

constructor state_holder<T, false>(state_holder<T, false> &&)

constexpr state_holder(state_holder&&)      = default

Fully qualified name: kfr::state_holder<T, false>::state_holder<T, false>(state_holder<T, false> &&)

constructor state_holder<T, false>(T)

constexpr state_holder(T state) noexcept : s(std::move(state)) { … }

Constructs the holder by moving in a state value.

Fully qualified name: kfr::state_holder<T, false>::state_holder<T, false>(T)

constructor state_holder<T, false>(std::reference_wrapper<T>)

constexpr state_holder(std::reference_wrapper<T> state)       = delete

Fully qualified name: kfr::state_holder<T, false>::state_holder<T, false>(std::reference_wrapper<T>)

constructor state_holder<T, false>(std::reference_wrapper<const T>)

constexpr state_holder(std::reference_wrapper<const T> state) = delete

Fully qualified name: kfr::state_holder<T, false>::state_holder<T, false>(std::reference_wrapper<const T>)

constructor state_holder<T, false>(state_holder<T, true>)

constexpr state_holder(state_holder<T, true> stateless) : s(*stateless) { … }

Converts a stateless holder into an owning one by copying the referenced state.

Fully qualified name: kfr::state_holder<T, false>::state_holder<T, false>(state_holder<T, true>)

variable s

T s

The owned state value.

Fully qualified name: kfr::state_holder<T, false>::s

function operator->()

const T* operator->() const

Returns a pointer to the state (const overload).

Fully qualified name: kfr::state_holder<T, false>::operator->()

function operator->()

T* operator->()

Returns a pointer to the state (non-const overload).

Fully qualified name: kfr::state_holder<T, false>::operator->()

function operator*()

const T& operator*() const

Returns a reference to the state (const overload).

Fully qualified name: kfr::state_holder<T, false>::operator*()

function operator*()

T& operator*()

Returns a reference to the state (non-const overload).

Fully qualified name: kfr::state_holder<T, false>::operator*()

Fully qualified name: kfr::state_holder<T, false>

Class state_holder

class state_holder<T, true> base

template <typename T>
struct state_holder<T, true> { … }

Stateless (non-owning) specialization of state_holder .

constructor state_holder<T, true>()

constexpr state_holder()                        = delete

Fully qualified name: kfr::state_holder<T, true>::state_holder<T, true>()

constructor state_holder<T, true>(const state_holder<T, true> &)

constexpr state_holder(const state_holder&)     = default

Fully qualified name: kfr::state_holder<T, true>::state_holder<T, true>(const state_holder<T, true> &)

constructor state_holder<T, true>(state_holder<T, true> &&)

constexpr state_holder(state_holder&&)          = default

Fully qualified name: kfr::state_holder<T, true>::state_holder<T, true>(state_holder<T, true> &&)

constructor state_holder<T, true>(T)

constexpr state_holder(T state) noexcept        = delete

Fully qualified name: kfr::state_holder<T, true>::state_holder<T, true>(T)

constructor state_holder<T, true>(const T &)

constexpr state_holder(const T& state) noexcept = delete

Fully qualified name: kfr::state_holder<T, true>::state_holder<T, true>(const T &)

constructor state_holder<T, true>(T &)

constexpr state_holder(T& state) noexcept       = delete

Fully qualified name: kfr::state_holder<T, true>::state_holder<T, true>(T &)

constructor state_holder<T, true>(T &&)

constexpr state_holder(T&& state) noexcept      = delete

Fully qualified name: kfr::state_holder<T, true>::state_holder<T, true>(T &&)

constructor state_holder<T, true>(std::reference_wrapper<T>)

constexpr state_holder(std::reference_wrapper<T> state) noexcept : s(&state.get()) { … }

Constructs the holder from a reference wrapper, storing a pointer to the referenced object.

Fully qualified name: kfr::state_holder<T, true>::state_holder<T, true>(std::reference_wrapper<T>)

variable s

T* s

Pointer to the externally owned state. Never null for a valid holder.

Fully qualified name: kfr::state_holder<T, true>::s

function operator->()

const T* operator->() const

Returns a pointer to the state (const overload).

Fully qualified name: kfr::state_holder<T, true>::operator->()

function operator->()

T* operator->()

Returns a pointer to the state (non-const overload).

Fully qualified name: kfr::state_holder<T, true>::operator->()

function operator*()

const T& operator*() const

Returns a reference to the state (const overload).

Fully qualified name: kfr::state_holder<T, true>::operator*()

function operator*()

T& operator*()

Returns a reference to the state (non-const overload).

Fully qualified name: kfr::state_holder<T, true>::operator*()

Fully qualified name: kfr::state_holder<T, true>

This file was generated by cxxdox, a C++ documentation generator based on MkDocs Material and libclang.