StormByte 3.0.0
C++26 foundation of the StormByte suite
Loading...
Searching...
No Matches
variant.hxx File Reference
#include <StormByte/safe/exception.hxx>
#include <StormByte/safe/hash.hxx>
#include <StormByte/safe/heap.hxx>
#include <StormByte/type_traits.hxx>
#include <StormByte/visibility.h>
#include <compare>
#include <cstddef>
#include <functional>
#include <new>
#include <tuple>
#include <type_traits>
#include <utility>
#include <variant>
#include <StormByte/safe/variant.txx>
Include dependency graph for variant.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  StormByte::Safe::Monostate
 Empty alternative. More...
struct  StormByte::Type::IsSafe< StormByte::Safe::Monostate >
struct  StormByte::Type::IsSafeValue< StormByte::Safe::Monostate >
class  StormByte::Safe::Variant< Ts >
 std::variant stored on Base's heap. More...
struct  StormByte::Type::IsSafe< StormByte::Safe::Variant< Ts... > >
struct  StormByte::Type::IsSafeValue< StormByte::Safe::Variant< Ts... > >
struct  StormByte::Safe::Hash< StormByte::Safe::Variant< Ts... > >
struct  StormByte::Safe::Hash< StormByte::Safe::Monostate >
struct  std::hash< StormByte::Safe::Variant< Ts... > >
struct  std::hash< StormByte::Safe::Monostate >

Namespaces

namespace  StormByte
 Root namespace of the StormByte suite.
namespace  StormByte::Safe
 Owned values that cross a DLL without the caller's CRT.

Functions

template<class T, Type::SafeValue... Ts>
bool StormByte::Safe::holds_alternative (const Variant< Ts... > &value) noexcept
 Whether value holds T.
template<std::size_t I, Type::SafeValue... Ts>
auto & StormByte::Safe::get (Variant< Ts... > &value)
 Read the alternative at I.
template<std::size_t I, Type::SafeValue... Ts>
const auto & StormByte::Safe::get (const Variant< Ts... > &value)
 Read the alternative at I.
template<class T, Type::SafeValue... Ts>
T & StormByte::Safe::get (Variant< Ts... > &value)
 Read the alternative T.
template<class T, Type::SafeValue... Ts>
const T & StormByte::Safe::get (const Variant< Ts... > &value)
 Read the alternative T.
template<std::size_t I, Type::SafeValue... Ts>
auto * StormByte::Safe::get_if (Variant< Ts... > *value) noexcept
 Pointer to the alternative at I, or null.
template<std::size_t I, Type::SafeValue... Ts>
const auto * StormByte::Safe::get_if (const Variant< Ts... > *value) noexcept
 Pointer to the alternative at I, or null.
template<class T, Type::SafeValue... Ts>
T * StormByte::Safe::get_if (Variant< Ts... > *value) noexcept
 Pointer to the alternative T, or null.
template<class T, Type::SafeValue... Ts>
const T * StormByte::Safe::get_if (const Variant< Ts... > *value) noexcept
 Pointer to the alternative T, or null.
template<class Visitor, Type::SafeValue... Ts>
decltype(auto) StormByte::Safe::visit (Visitor &&visitor, Variant< Ts... > &value)
 Call visitor with the active alternative.
template<class Visitor, Type::SafeValue... Ts>
decltype(auto) StormByte::Safe::visit (Visitor &&visitor, const Variant< Ts... > &value)
 Call visitor with the active alternative.
template<Type::SafeValue... Ts>
void StormByte::Safe::swap (Variant< Ts... > &left, Variant< Ts... > &right) noexcept
 Swaps two variants.