Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
absl::any Class Reference

#include <any.h>

Classes

struct  IsInPlaceType
 
struct  IsInPlaceType< in_place_type_t< T > >
 
class  Obj
 
class  ObjInterface
 

Public Member Functions

constexpr any () noexcept
 
 any (const any &other)
 
 any (any &&other) noexcept=default
 
template<typename T , typename VT = absl::decay_t<T>, absl::enable_if_t<!absl::disjunction< std::is_same< any, VT >, IsInPlaceType< VT >, absl::negation< std::is_copy_constructible< VT > > >::value > * = nullptr>
 any (T &&value)
 
template<typename T , typename... Args, typename VT = absl::decay_t<T>, absl::enable_if_t< absl::conjunction< std::is_copy_constructible< VT >, std::is_constructible< VT, Args... >>::value > * = nullptr>
 any (in_place_type_t< T >, Args &&... args)
 
template<typename T , typename U , typename... Args, typename VT = absl::decay_t<T>, absl::enable_if_t< absl::conjunction< std::is_copy_constructible< VT >, std::is_constructible< VT, std::initializer_list< U > &, Args... >>::value > * = nullptr>
 any (in_place_type_t< T >, std::initializer_list< U > ilist, Args &&... args)
 
template<typename T , typename... Args, typename VT = absl::decay_t<T>, absl::enable_if_t< std::is_copy_constructible< VT >::value &&std::is_constructible< VT, Args... >::value > * = nullptr>
VT & emplace (Args &&... args)
 
template<typename T , typename U , typename... Args, typename VT = absl::decay_t<T>, absl::enable_if_t< std::is_copy_constructible< VT >::value &&std::is_constructible< VT, std::initializer_list< U > &, Args... >::value > * = nullptr>
VT & emplace (std::initializer_list< U > ilist, Args &&... args)
 
bool has_value () const noexcept
 
anyoperator= (const any &rhs)
 
anyoperator= (any &&rhs) noexcept
 
template<typename T , typename VT = absl::decay_t<T>, absl::enable_if_t< absl::conjunction< absl::negation< std::is_same< VT, any >>, std::is_copy_constructible< VT >>::value > * = nullptr>
anyoperator= (T &&rhs)
 
void reset () noexcept
 
void swap (any &other) noexcept
 
const std::type_info & type () const noexcept
 

Private Member Functions

std::unique_ptr< ObjInterfaceCloneObj () const
 
const void * GetObjTypeId () const
 

Static Private Member Functions

template<typename T >
static constexpr const void * IdForType ()
 

Private Attributes

std::unique_ptr< ObjInterfaceobj_
 

Friends

template<typename ValueType >
ValueType any_cast (const any &operand)
 
template<typename ValueType >
ValueType any_cast (any &operand)
 
template<typename T >
const T * any_cast (const any *operand) noexcept
 
template<typename T >
T * any_cast (any *operand) noexcept
 

Detailed Description

Definition at line 214 of file any.h.

Constructor & Destructor Documentation

◆ any() [1/6]

constexpr absl::any::any ( )
defaultnoexcept

◆ any() [2/6]

absl::any::any ( const any other)
inline

Definition at line 229 of file any.h.

◆ any() [3/6]

absl::any::any ( any &&  other)
defaultnoexcept

◆ any() [4/6]

template<typename T , typename VT = absl::decay_t<T>, absl::enable_if_t<!absl::disjunction< std::is_same< any, VT >, IsInPlaceType< VT >, absl::negation< std::is_copy_constructible< VT > > >::value > * = nullptr>
absl::any::any ( T &&  value)
inline

Definition at line 248 of file any.h.

◆ any() [5/6]

template<typename T , typename... Args, typename VT = absl::decay_t<T>, absl::enable_if_t< absl::conjunction< std::is_copy_constructible< VT >, std::is_constructible< VT, Args... >>::value > * = nullptr>
absl::any::any ( in_place_type_t< T >  ,
Args &&...  args 
)
inlineexplicit

Definition at line 256 of file any.h.

◆ any() [6/6]

template<typename T , typename U , typename... Args, typename VT = absl::decay_t<T>, absl::enable_if_t< absl::conjunction< std::is_copy_constructible< VT >, std::is_constructible< VT, std::initializer_list< U > &, Args... >>::value > * = nullptr>
absl::any::any ( in_place_type_t< T >  ,
std::initializer_list< U >  ilist,
Args &&...  args 
)
inlineexplicit

Definition at line 269 of file any.h.

Member Function Documentation

◆ CloneObj()

std::unique_ptr<ObjInterface> absl::any::CloneObj ( ) const
inlineprivate

Definition at line 412 of file any.h.

◆ emplace() [1/2]

template<typename T , typename... Args, typename VT = absl::decay_t<T>, absl::enable_if_t< std::is_copy_constructible< VT >::value &&std::is_constructible< VT, Args... >::value > * = nullptr>
VT& absl::any::emplace ( Args &&...  args)
inline

Definition at line 316 of file any.h.

◆ emplace() [2/2]

template<typename T , typename U , typename... Args, typename VT = absl::decay_t<T>, absl::enable_if_t< std::is_copy_constructible< VT >::value &&std::is_constructible< VT, std::initializer_list< U > &, Args... >::value > * = nullptr>
VT& absl::any::emplace ( std::initializer_list< U >  ilist,
Args &&...  args 
)
inline

Definition at line 340 of file any.h.

◆ GetObjTypeId()

const void* absl::any::GetObjTypeId ( ) const
inlineprivate

Definition at line 426 of file any.h.

◆ has_value()

bool absl::any::has_value ( ) const
inlinenoexcept

Definition at line 365 of file any.h.

◆ IdForType()

template<typename T >
static constexpr const void* absl::any::IdForType ( )
inlinestaticprivate

Definition at line 418 of file any.h.

◆ operator=() [1/3]

any& absl::any::operator= ( const any rhs)
inline

Definition at line 277 of file any.h.

◆ operator=() [2/3]

any& absl::any::operator= ( any &&  rhs)
inlinenoexcept

Definition at line 284 of file any.h.

◆ operator=() [3/3]

template<typename T , typename VT = absl::decay_t<T>, absl::enable_if_t< absl::conjunction< absl::negation< std::is_same< VT, any >>, std::is_copy_constructible< VT >>::value > * = nullptr>
any& absl::any::operator= ( T &&  rhs)
inline

Definition at line 294 of file any.h.

◆ reset()

void absl::any::reset ( )
inlinenoexcept

Definition at line 352 of file any.h.

◆ swap()

void absl::any::swap ( any other)
inlinenoexcept

Definition at line 357 of file any.h.

◆ type()

const std::type_info& absl::any::type ( ) const
inlinenoexcept

Definition at line 370 of file any.h.

Friends And Related Function Documentation

◆ any_cast [1/4]

template<typename ValueType >
ValueType any_cast ( const any operand)
friend

Definition at line 479 of file any.h.

◆ any_cast [2/4]

template<typename ValueType >
ValueType any_cast ( any operand)
friend

Definition at line 493 of file any.h.

◆ any_cast [3/4]

template<typename T >
const T* any_cast ( const any operand)
friend

Definition at line 517 of file any.h.

◆ any_cast [4/4]

template<typename T >
T* any_cast ( any operand)
friend

Definition at line 526 of file any.h.

Member Data Documentation

◆ obj_

std::unique_ptr<ObjInterface> absl::any::obj_
private

Definition at line 448 of file any.h.


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


abseil_cpp
Author(s):
autogenerated on Mon Feb 28 2022 21:31:22