KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ki Namespace Reference

Classes

class  any
 A type-safe container of any type. More...
 
class  bad_any_cast
 Exception class thrown by a failed any_cast. More...
 

Functions

void swap (any &x, any &y) noexcept
 Exchange the states of two any objects.
 
template<typename T, typename... Args>
std::enable_if_t< std::is_constructible_v< any, std::in_place_type_t< T >, Args... >, anymake_any (Args &&... args)
 Create a any holding a T constructed from args....
 
template<typename T, typename U, typename... Args>
std::enable_if_t< std::is_constructible_v< any, std::in_place_type_t< T >, std::initializer_list< U > &, Args... >, anymake_any (std::initializer_list< U > il, Args &&... args)
 Create an any holding a T constructed from il and args....
 
template<typename ValueType>
ValueType any_cast (const any &any)
 Access the contained object.
 
template<typename ValueType>
ValueType any_cast (any &any)
 Access the contained object.
 
template<typename ValueType>
ValueType any_cast (any &&any)
 
template<typename ValueType>
const ValueType * any_cast (const any *any) noexcept
 Access the contained object.
 
template<typename ValueType>
ValueType * any_cast (any *any) noexcept
 

Variables

template<typename>
constexpr bool is_in_place_type_v = false
 
template<typename T>
constexpr bool is_in_place_type_v< std::in_place_type_t< T > > = true
 

Function Documentation

◆ any_cast() [1/5]

template<typename ValueType>
ValueType ki::any_cast ( any && any)

Definition at line 493 of file ki_any.h.

References any_cast().

◆ any_cast() [2/5]

template<typename ValueType>
ValueType ki::any_cast ( any & any)

Access the contained object.

Template Parameters
ValueTypeA reference or CopyConstructible type.
Parameters
anyThe object to access.
Returns
The contained object.
Exceptions
bad_any_castIf any.type() != typeid(remove_reference_t<ValueType>)

Definition at line 475 of file ki_any.h.

References any_cast().

◆ any_cast() [3/5]

template<typename ValueType>
ValueType * ki::any_cast ( any * any)
noexcept

Definition at line 569 of file ki_any.h.

◆ any_cast() [4/5]

template<typename ValueType>
ValueType ki::any_cast ( const any & any)

Access the contained object.

Template Parameters
ValueTypeA const-reference or CopyConstructible type.
Parameters
anyThe object to access.
Returns
The contained object.
Exceptions
bad_any_castIf any.type() != typeid(remove_reference_t<ValueType>)

Definition at line 446 of file ki_any.h.

References any_cast().

Referenced by any_cast(), any_cast(), any_cast(), TOOL_ACTION::GetParam(), and TOOL_EVENT::Parameter().

◆ any_cast() [5/5]

template<typename ValueType>
const ValueType * ki::any_cast ( const any * any)
noexcept

Access the contained object.

Template Parameters
ValueTypeThe type of the contained object.
Parameters
anyA pointer to the object to access.
Returns
The address of the contained object if any != nullptr && any.type() == typeid(ValueType) , otherwise a null pointer.

Definition at line 553 of file ki_any.h.

◆ make_any() [1/2]

template<typename T, typename... Args>
std::enable_if_t< std::is_constructible_v< any, std::in_place_type_t< T >, Args... >, any > ki::make_any ( Args &&... args)

Create a any holding a T constructed from args....

Definition at line 420 of file ki_any.h.

Referenced by BOOST_AUTO_TEST_CASE().

◆ make_any() [2/2]

template<typename T, typename U, typename... Args>
std::enable_if_t< std::is_constructible_v< any, std::in_place_type_t< T >, std::initializer_list< U > &, Args... >, any > ki::make_any ( std::initializer_list< U > il,
Args &&... args )

Create an any holding a T constructed from il and args....

Definition at line 430 of file ki_any.h.

◆ swap()

void ki::swap ( any & x,
any & y )
inlinenoexcept

Exchange the states of two any objects.

Definition at line 412 of file ki_any.h.

Variable Documentation

◆ is_in_place_type_v

template<typename>
bool ki::is_in_place_type_v = false
inlineconstexpr

Definition at line 72 of file ki_any.h.

◆ is_in_place_type_v< std::in_place_type_t< T > >

template<typename T>
bool ki::is_in_place_type_v< std::in_place_type_t< T > > = true
inlineconstexpr

Definition at line 75 of file ki_any.h.