Public Member Functions | Private Types | Friends | List of all members
absl::variant< T0, Tn... > Class Template Reference

#include <variant.h>

Inheritance diagram for absl::variant< T0, Tn... >:
Inheritance graph
[legend]

Public Member Functions

template<class T , class... Args, typename std::enable_if< std::is_constructible< absl::variant_alternative_t< variant_internal::UnambiguousIndexOf< variant, T >::value, variant >, Args... >::value >::type * = nullptr>
T & emplace (Args &&...args)
 
template<class T , class U , class... Args, typename std::enable_if< std::is_constructible< absl::variant_alternative_t< variant_internal::UnambiguousIndexOf< variant, T >::value, variant >, std::initializer_list< U > &, Args... >::value >::type * = nullptr>
T & emplace (std::initializer_list< U > il, Args &&...args)
 
template<std::size_t I, class... Args, typename std::enable_if< std::is_constructible< absl::variant_alternative_t< I, variant >, Args... >::value >::type * = nullptr>
absl::variant_alternative_t< I, variant > & emplace (Args &&...args)
 
template<std::size_t I, class U , class... Args, typename std::enable_if< std::is_constructible< absl::variant_alternative_t< I, variant >, std::initializer_list< U > &, Args... >::value >::type * = nullptr>
absl::variant_alternative_t< I, variant > & emplace (std::initializer_list< U > il, Args &&...args)
 
constexpr std::size_t index () const noexcept
 
variantoperator= (const variant &other)=default
 
variantoperator= (variant &&other)=default
 
template<class T , std::size_t I = std::enable_if< !std::is_same<absl::decay_t<T>, variant>::value, variant_internal::IndexOfConstructedType<variant, T>>::type::value, class Tj = absl::variant_alternative_t<I, variant>, typename std::enable_if< std::is_assignable< Tj &, T >::value &&std::is_constructible< Tj, T >::value >::type * = nullptr>
variantoperator= (T &&t) noexcept(std::is_nothrow_assignable< Tj &, T >::value &&std::is_nothrow_constructible< Tj, T >::value)
 
void swap (variant &rhs) noexcept(absl::conjunction< std::is_nothrow_move_constructible< T0 >, std::is_nothrow_move_constructible< Tn >..., type_traits_internal::IsNothrowSwappable< T0 >, type_traits_internal::IsNothrowSwappable< Tn >... >::value)
 
constexpr bool valueless_by_exception () const noexcept
 
constexpr variant ()=default
 
 variant (const variant &other)=default
 
 variant (variant &&other)=default
 
template<class T , std::size_t I = std::enable_if< variant_internal::IsNeitherSelfNorInPlace<variant, absl::decay_t<T>>::value, variant_internal::IndexOfConstructedType<variant, T>>::type::value, class Tj = absl::variant_alternative_t<I, variant>, absl::enable_if_t< std::is_constructible< Tj, T >::value > * = nullptr>
constexpr variant (T &&t) noexcept(std::is_nothrow_constructible< Tj, T >::value)
 
template<class T , class... Args, typename std::enable_if< std::is_constructible< variant_internal::UnambiguousTypeOfT< variant, T >, Args... >::value >::type * = nullptr>
constexpr variant (in_place_type_t< T >, Args &&...args)
 
template<class T , class U , class... Args, typename std::enable_if< std::is_constructible< variant_internal::UnambiguousTypeOfT< variant, T >, std::initializer_list< U > &, Args... >::value >::type * = nullptr>
constexpr variant (in_place_type_t< T >, std::initializer_list< U > il, Args &&...args)
 
template<std::size_t I, class... Args, typename std::enable_if< std::is_constructible< variant_internal::VariantAlternativeSfinaeT< I, variant >, Args... >::value >::type * = nullptr>
constexpr variant (in_place_index_t< I >, Args &&...args)
 
template<std::size_t I, class U , class... Args, typename std::enable_if< std::is_constructible< variant_internal::VariantAlternativeSfinaeT< I, variant >, std::initializer_list< U > &, Args... >::value >::type * = nullptr>
constexpr variant (in_place_index_t< I >, std::initializer_list< U > il, Args &&...args)
 
 ~variant ()=default
 

Private Types

using Base = variant_internal::VariantBase< T0, Tn... >
 

Friends

struct variant_internal::VariantCoreAccess
 

Detailed Description

template<typename T0, typename... Tn>
class absl::variant< T0, Tn... >

Definition at line 457 of file variant.h.

Member Typedef Documentation

template<typename T0 , typename... Tn>
using absl::variant< T0, Tn... >::Base = variant_internal::VariantBase<T0, Tn...>
private

Definition at line 475 of file variant.h.

Constructor & Destructor Documentation

template<typename T0 , typename... Tn>
constexpr absl::variant< T0, Tn... >::variant ( )
default
template<typename T0 , typename... Tn>
absl::variant< T0, Tn... >::variant ( const variant< T0, Tn... > &  other)
default
template<typename T0 , typename... Tn>
absl::variant< T0, Tn... >::variant ( variant< T0, Tn... > &&  other)
default
template<typename T0 , typename... Tn>
template<class T , std::size_t I = std::enable_if< variant_internal::IsNeitherSelfNorInPlace<variant, absl::decay_t<T>>::value, variant_internal::IndexOfConstructedType<variant, T>>::type::value, class Tj = absl::variant_alternative_t<I, variant>, absl::enable_if_t< std::is_constructible< Tj, T >::value > * = nullptr>
constexpr absl::variant< T0, Tn... >::variant ( T &&  t)
inlinenoexcept

Definition at line 509 of file variant.h.

template<typename T0 , typename... Tn>
template<class T , class... Args, typename std::enable_if< std::is_constructible< variant_internal::UnambiguousTypeOfT< variant, T >, Args... >::value >::type * = nullptr>
constexpr absl::variant< T0, Tn... >::variant ( in_place_type_t< T >  ,
Args &&...  args 
)
inlineexplicit

Definition at line 521 of file variant.h.

template<typename T0 , typename... Tn>
template<class T , class U , class... Args, typename std::enable_if< std::is_constructible< variant_internal::UnambiguousTypeOfT< variant, T >, std::initializer_list< U > &, Args... >::value >::type * = nullptr>
constexpr absl::variant< T0, Tn... >::variant ( in_place_type_t< T >  ,
std::initializer_list< U >  il,
Args &&...  args 
)
inlineexplicit

Definition at line 535 of file variant.h.

template<typename T0 , typename... Tn>
template<std::size_t I, class... Args, typename std::enable_if< std::is_constructible< variant_internal::VariantAlternativeSfinaeT< I, variant >, Args... >::value >::type * = nullptr>
constexpr absl::variant< T0, Tn... >::variant ( in_place_index_t< I >  ,
Args &&...  args 
)
inlineexplicit

Definition at line 547 of file variant.h.

template<typename T0 , typename... Tn>
template<std::size_t I, class U , class... Args, typename std::enable_if< std::is_constructible< variant_internal::VariantAlternativeSfinaeT< I, variant >, std::initializer_list< U > &, Args... >::value >::type * = nullptr>
constexpr absl::variant< T0, Tn... >::variant ( in_place_index_t< I >  ,
std::initializer_list< U >  il,
Args &&...  args 
)
inlineexplicit

Definition at line 557 of file variant.h.

template<typename T0 , typename... Tn>
absl::variant< T0, Tn... >::~variant ( )
default

Member Function Documentation

template<typename T0 , typename... Tn>
template<class T , class... Args, typename std::enable_if< std::is_constructible< absl::variant_alternative_t< variant_internal::UnambiguousIndexOf< variant, T >::value, variant >, Args... >::value >::type * = nullptr>
T& absl::variant< T0, Tn... >::emplace ( Args &&...  args)
inline

Definition at line 617 of file variant.h.

template<typename T0 , typename... Tn>
template<class T , class U , class... Args, typename std::enable_if< std::is_constructible< absl::variant_alternative_t< variant_internal::UnambiguousIndexOf< variant, T >::value, variant >, std::initializer_list< U > &, Args... >::value >::type * = nullptr>
T& absl::variant< T0, Tn... >::emplace ( std::initializer_list< U >  il,
Args &&...  args 
)
inline

Definition at line 636 of file variant.h.

template<typename T0 , typename... Tn>
template<std::size_t I, class... Args, typename std::enable_if< std::is_constructible< absl::variant_alternative_t< I, variant >, Args... >::value >::type * = nullptr>
absl::variant_alternative_t<I, variant>& absl::variant< T0, Tn... >::emplace ( Args &&...  args)
inline

Definition at line 656 of file variant.h.

template<typename T0 , typename... Tn>
template<std::size_t I, class U , class... Args, typename std::enable_if< std::is_constructible< absl::variant_alternative_t< I, variant >, std::initializer_list< U > &, Args... >::value >::type * = nullptr>
absl::variant_alternative_t<I, variant>& absl::variant< T0, Tn... >::emplace ( std::initializer_list< U >  il,
Args &&...  args 
)
inline

Definition at line 673 of file variant.h.

template<typename T0 , typename... Tn>
constexpr std::size_t absl::variant< T0, Tn... >::index ( ) const
inlinenoexcept

Definition at line 690 of file variant.h.

template<typename T0 , typename... Tn>
variant& absl::variant< T0, Tn... >::operator= ( const variant< T0, Tn... > &  other)
default
template<typename T0 , typename... Tn>
variant& absl::variant< T0, Tn... >::operator= ( variant< T0, Tn... > &&  other)
default
template<typename T0 , typename... Tn>
template<class T , std::size_t I = std::enable_if< !std::is_same<absl::decay_t<T>, variant>::value, variant_internal::IndexOfConstructedType<variant, T>>::type::value, class Tj = absl::variant_alternative_t<I, variant>, typename std::enable_if< std::is_assignable< Tj &, T >::value &&std::is_constructible< Tj, T >::value >::type * = nullptr>
variant& absl::variant< T0, Tn... >::operator= ( T &&  t)
inlinenoexcept

Definition at line 590 of file variant.h.

template<typename T0 , typename... Tn>
void absl::variant< T0, Tn... >::swap ( variant< T0, Tn... > &  rhs)
inlinenoexcept

Definition at line 696 of file variant.h.

template<typename T0 , typename... Tn>
constexpr bool absl::variant< T0, Tn... >::valueless_by_exception ( ) const
inlinenoexcept

Definition at line 682 of file variant.h.

Friends And Related Function Documentation

template<typename T0 , typename... Tn>
friend struct variant_internal::VariantCoreAccess
friend

Definition at line 461 of file variant.h.


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


abseil_cpp
Author(s):
autogenerated on Wed Jun 19 2019 19:19:59