Shaka Player Embedded
Public Member Functions | Friends | List of all members
shaka::variant< Types > Class Template Reference

#include <variant.h>

Public Member Functions

 variant ()
 
template<typename U , typename = typename std::enable_if<!impl::is_variant< typename std::decay<U>::type>::value>::type>
 variant (U &&value)
 
 variant (const variant &other)
 
 variant (variant &&other)
 
 ~variant ()
 
variantoperator= (const variant &other)
 
variantoperator= (variant &&other)
 
size_t index () const
 
template<typename T , typename... Args>
T & emplace (Args &&... args)
 
template<size_t I, typename... Args>
variant_alternative_t< I, variant > & emplace (Args &&... args)
 

Friends

template<typename... >
class variant
 
template<typename... Choices>
bool operator== (const variant< Choices... > &, const variant< Choices... > &)
 
template<size_t I, typename... Choices>
impl::get_const_reference_at_t< I, Choices... > get (const variant< Choices... > &)
 
template<size_t I, typename... Choices>
variant_alternative_t< I, variant< Choices... > > & get (variant< Choices... > &)
 
template<typename T , typename... Choices>
const T & get (const variant< Choices... > &)
 
template<typename T , typename... Choices>
T & get (variant< Choices... > &)
 
template<typename T , typename... Choices>
T && get (variant< Choices... > &&)
 
template<size_t I, typename... Choices>
std::add_const< variant_alternative_t< I, variant< Choices... > > >::typeget_if (const variant< Choices... > &)
 
template<size_t I, typename... Choices>
variant_alternative_t< I, variant< Choices... > > * get_if (variant< Choices... > &)
 
template<typename T , typename... Choices>
const T * get_if (const variant< Choices... > &)
 
template<typename T , typename... Choices>
T * get_if (variant< Choices... > &)
 

Detailed Description

template<typename... Types>
class shaka::variant< Types >

This is a look-alike for the std::variant type. The most common usages of this type have been implemented, but this is not a general implementation. For example, this doesn't throw exceptions and instead asserts.

See also
https://en.cppreference.com/w/cpp/utility/variant

Definition at line 36 of file variant.h.

Constructor & Destructor Documentation

§ variant() [1/4]

template<typename... Types>
shaka::variant< Types >::variant ( )
inline

Definition at line 303 of file variant.h.

§ variant() [2/4]

template<typename... Types>
template<typename U , typename = typename std::enable_if<!impl::is_variant< typename std::decay<U>::type>::value>::type>
shaka::variant< Types >::variant ( U &&  value)
inline

Definition at line 309 of file variant.h.

§ variant() [3/4]

template<typename... Types>
shaka::variant< Types >::variant ( const variant< Types > &  other)
inline

Definition at line 315 of file variant.h.

§ variant() [4/4]

template<typename... Types>
shaka::variant< Types >::variant ( variant< Types > &&  other)
inline

Definition at line 319 of file variant.h.

§ ~variant()

template<typename... Types>
shaka::variant< Types >::~variant ( )
inline

Definition at line 323 of file variant.h.

Member Function Documentation

§ emplace() [1/2]

template<typename... Types>
template<typename T , typename... Args>
T& shaka::variant< Types >::emplace ( Args &&...  args)
inline

Definition at line 345 of file variant.h.

§ emplace() [2/2]

template<typename... Types>
template<size_t I, typename... Args>
variant_alternative_t<I, variant>& shaka::variant< Types >::emplace ( Args &&...  args)
inline

Definition at line 354 of file variant.h.

§ index()

template<typename... Types>
size_t shaka::variant< Types >::index ( ) const
inline

Definition at line 340 of file variant.h.

§ operator=() [1/2]

template<typename... Types>
variant& shaka::variant< Types >::operator= ( const variant< Types > &  other)
inline

Definition at line 327 of file variant.h.

§ operator=() [2/2]

template<typename... Types>
variant& shaka::variant< Types >::operator= ( variant< Types > &&  other)
inline

Definition at line 333 of file variant.h.

Friends And Related Function Documentation

§ get [1/5]

template<typename... Types>
template<size_t I, typename... Choices>
impl::get_const_reference_at_t<I, Choices...> get ( const variant< Choices... > &  variant)
friend

Definition at line 456 of file variant.h.

§ get [2/5]

template<typename... Types>
template<size_t I, typename... Choices>
variant_alternative_t<I, variant<Choices...> >& get ( variant< Choices... > &  variant)
friend

Definition at line 462 of file variant.h.

§ get [3/5]

template<typename... Types>
template<typename T , typename... Choices>
const T& get ( const variant< Choices... > &  variant)
friend

Definition at line 456 of file variant.h.

§ get [4/5]

template<typename... Types>
template<typename T , typename... Choices>
T& get ( variant< Choices... > &  variant)
friend

Definition at line 462 of file variant.h.

§ get [5/5]

template<typename... Types>
template<typename T , typename... Choices>
T&& get ( variant< Choices... > &&  variant)
friend

Definition at line 480 of file variant.h.

§ get_if [1/4]

template<typename... Types>
template<size_t I, typename... Choices>
std::add_const< variant_alternative_t<I, variant<Choices...> > >::type* get_if ( const variant< Choices... > &  variant)
friend

Definition at line 488 of file variant.h.

§ get_if [2/4]

template<typename... Types>
template<size_t I, typename... Choices>
variant_alternative_t<I, variant<Choices...> >* get_if ( variant< Choices... > &  variant)
friend

Definition at line 496 of file variant.h.

§ get_if [3/4]

template<typename... Types>
template<typename T , typename... Choices>
const T* get_if ( const variant< Choices... > &  variant)
friend

Definition at line 488 of file variant.h.

§ get_if [4/4]

template<typename... Types>
template<typename T , typename... Choices>
T* get_if ( variant< Choices... > &  variant)
friend

Definition at line 496 of file variant.h.

§ operator==

template<typename... Types>
template<typename... Choices>
bool operator== ( const variant< Choices... > &  lhs,
const variant< Choices... > &  rhs 
)
friend

Definition at line 436 of file variant.h.

§ variant

template<typename... Types>
template<typename... >
friend class variant
friend

Definition at line 363 of file variant.h.


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