Flecs v3.2
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
Pair type

Compile time utilities for working with relationship pairs. More...

Classes

struct  flecs::_::pair_base
 
struct  flecs::pair< First, Second >
 Type that represents a pair. More...
 
struct  flecs::is_pair< T >
 Test if type is a pair. More...
 
struct  flecs::actual_type< T, U >
 Get actual type from a regular type or pair. More...
 
struct  flecs::actual_type< T, if_not_t< is_pair< T >::value > >
 
struct  flecs::actual_type< T, if_t< is_pair< T >::value > >
 
struct  flecs::base_type< T >
 
struct  flecs::base_arg_type< T >
 
struct  flecs::is_actual< T >
 

Typedefs

using flecs::pair< First, Second >::type = conditional_t<!is_empty< First >::value||is_empty< Second >::value, First, Second >
 
using flecs::pair< First, Second >::first = First
 
using flecs::pair< First, Second >::second = Second
 
template<typename First , typename Second , if_t< is_empty< First >::value > = 0>
using flecs::pair_object = pair< First, Second >
 
template<typename P >
using flecs::pair_first_t = transcribe_cv_t< remove_reference_t< P >, typename remove_reference_t< P >::first >
 Get pair::first from pair while preserving cv qualifiers. More...
 
template<typename P >
using flecs::pair_second_t = transcribe_cv_t< remove_reference_t< P >, typename remove_reference_t< P >::second >
 Get pair::second from pair while preserving cv qualifiers. More...
 
template<typename P >
using flecs::pair_type_t = transcribe_cv_t< remove_reference_t< P >, typename remove_reference_t< P >::type >
 Get pair::type type from pair while preserving cv qualifiers. More...
 
using flecs::actual_type< T, if_not_t< is_pair< T >::value > >::type = T
 
using flecs::actual_type< T, if_t< is_pair< T >::value > >::type = pair_type_t< T >
 
template<typename T >
using flecs::actual_type_t = typename actual_type< T >::type
 
using flecs::base_type< T >::type = decay_t< remove_pointer_t< actual_type_t< T > > >
 
template<typename T >
using flecs::base_type_t = typename base_type< T >::type
 
using flecs::base_arg_type< T >::type = remove_pointer_t< remove_reference_t< actual_type_t< T > > >
 
template<typename T >
using flecs::base_arg_type_t = typename base_arg_type< T >::type
 

Functions

 flecs::pair< First, Second >::pair (type &v)
 
 flecs::pair< First, Second >::pair (const type &v)
 
 flecs::pair< First, Second >::operator type & ()
 
 flecs::pair< First, Second >::operator const type & () const
 
type * flecs::pair< First, Second >::operator-> ()
 
const type * flecs::pair< First, Second >::operator-> () const
 
type & flecs::pair< First, Second >::operator* ()
 
const type & flecs::pair< First, Second >::operator* () const
 

Variables

static constexpr bool flecs::is_pair< T >::value = is_base_of<_::pair_base, remove_reference_t<T> >::value
 
static constexpr bool flecs::is_actual< T >::value
 

Detailed Description

Compile time utilities for working with relationship pairs.

Typedef Documentation

◆ actual_type_t

template<typename T >
using flecs::actual_type_t = typedef typename actual_type<T>::type

Definition at line 112 of file pair.hpp.

◆ base_arg_type_t

template<typename T >
using flecs::base_arg_type_t = typedef typename base_arg_type<T>::type

Definition at line 132 of file pair.hpp.

◆ base_type_t

template<typename T >
using flecs::base_type_t = typedef typename base_type<T>::type

Definition at line 122 of file pair.hpp.

◆ first

template<typename First , typename Second >
using flecs::pair< First, Second >::first = First

Definition at line 38 of file pair.hpp.

◆ pair_first_t

template<typename P >
using flecs::pair_first_t = typedef transcribe_cv_t<remove_reference_t<P>, typename remove_reference_t<P>::first>

Get pair::first from pair while preserving cv qualifiers.

Definition at line 87 of file pair.hpp.

◆ pair_object

template<typename First , typename Second , if_t< is_empty< First >::value > = 0>
using flecs::pair_object = typedef pair<First, Second>

Definition at line 75 of file pair.hpp.

◆ pair_second_t

template<typename P >
using flecs::pair_second_t = typedef transcribe_cv_t<remove_reference_t<P>, typename remove_reference_t<P>::second>

Get pair::second from pair while preserving cv qualifiers.

Definition at line 91 of file pair.hpp.

◆ pair_type_t

template<typename P >
using flecs::pair_type_t = typedef transcribe_cv_t<remove_reference_t<P>, typename remove_reference_t<P>::type>

Get pair::type type from pair while preserving cv qualifiers.

Definition at line 95 of file pair.hpp.

◆ second

template<typename First , typename Second >
using flecs::pair< First, Second >::second = Second

Definition at line 39 of file pair.hpp.

◆ type [1/5]

template<typename First , typename Second >
using flecs::pair< First, Second >::type = conditional_t<!is_empty<First>::value || is_empty<Second>::value, First, Second>

Definition at line 37 of file pair.hpp.

◆ type [2/5]

template<typename T >
using flecs::actual_type< T, if_not_t< is_pair< T >::value > >::type = T

Definition at line 103 of file pair.hpp.

◆ type [3/5]

template<typename T >
using flecs::actual_type< T, if_t< is_pair< T >::value > >::type = pair_type_t<T>

Definition at line 108 of file pair.hpp.

◆ type [4/5]

template<typename T >
using flecs::base_type< T >::type = decay_t< remove_pointer_t< actual_type_t<T> > >

Definition at line 118 of file pair.hpp.

◆ type [5/5]

template<typename T >
using flecs::base_arg_type< T >::type = remove_pointer_t< remove_reference_t< actual_type_t<T> > >

Definition at line 128 of file pair.hpp.

Function Documentation

◆ operator const type &()

template<typename First , typename Second >
flecs::pair< First, Second >::operator const type & ( ) const
inline

Definition at line 50 of file pair.hpp.

◆ operator type &()

template<typename First , typename Second >
flecs::pair< First, Second >::operator type & ( )
inline

Definition at line 46 of file pair.hpp.

◆ operator*() [1/2]

template<typename First , typename Second >
type & flecs::pair< First, Second >::operator* ( )
inline

Definition at line 62 of file pair.hpp.

◆ operator*() [2/2]

template<typename First , typename Second >
const type & flecs::pair< First, Second >::operator* ( ) const
inline

Definition at line 66 of file pair.hpp.

◆ operator->() [1/2]

template<typename First , typename Second >
type * flecs::pair< First, Second >::operator-> ( )
inline

Definition at line 54 of file pair.hpp.

◆ operator->() [2/2]

template<typename First , typename Second >
const type * flecs::pair< First, Second >::operator-> ( ) const
inline

Definition at line 58 of file pair.hpp.

◆ pair() [1/2]

template<typename First , typename Second >
flecs::pair< First, Second >::pair ( const type &  v)
inline

Definition at line 44 of file pair.hpp.

◆ pair() [2/2]

template<typename First , typename Second >
flecs::pair< First, Second >::pair ( type &  v)
inline

Definition at line 41 of file pair.hpp.

Variable Documentation

◆ value [1/2]

template<typename T >
constexpr bool flecs::is_pair< T >::value = is_base_of<_::pair_base, remove_reference_t<T> >::value
staticconstexpr

Definition at line 81 of file pair.hpp.

◆ value [2/2]

template<typename T >
constexpr bool flecs::is_actual< T >::value
staticconstexpr
Initial value:
=
std::is_same<T, actual_type_t<T> >::value && !is_enum<T>::value

Definition at line 138 of file pair.hpp.