Flecs: Pair type
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.0 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
Pair type
C++ API » Core

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

Collaboration diagram for Pair type:

## 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 T>
using | flecs::raw_type_t = remove_pointer_t<remove_reference_t<T>>
template<typename P>
using | flecs::pair_first_t = transcribe_cv_t<remove_reference_t<P>, typename raw_type_t<P>::first>
| Get pair::first from pair while preserving cv qualifiers.
template<typename P>
using | flecs::pair_second_t = transcribe_cv_t<remove_reference_t<P>, typename raw_type_t<P>::second>
| Get pair::second from pair while preserving cv qualifiers.
template<typename P>
using | flecs::pair_type_t = transcribe_cvp_t<remove_reference_t<P>, typename raw_type_t<P>::type>
| Get pair::type type from pair while preserving cv qualifiers and pointer type.
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< 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, raw_type_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 = typename actual_type<T>::type

Definition at line 113 of file pair.hpp.

## ◆ base_arg_type_t

template<typename T>

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

Definition at line 133 of file pair.hpp.

## ◆ base_type_t

template<typename T>

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

Definition at line 123 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 = transcribe_cv_t<remove_reference_t<P>, typename raw_type_t<P>::first>

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

Definition at line 88 of file pair.hpp.

## ◆ pair_object

template<typename First, typename Second, if_t< is_empty< First >::value > = 0>

using flecs::pair_object = pair<First, Second>

Definition at line 75 of file pair.hpp.

## ◆ pair_second_t

template<typename P>

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

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

Definition at line 92 of file pair.hpp.

## ◆ pair_type_t

template<typename P>

using flecs::pair_type_t = transcribe_cvp_t<remove_reference_t<P>, typename raw_type_t<P>::type>

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

Definition at line 96 of file pair.hpp.

## ◆ raw_type_t

template<typename T>

using flecs::raw_type_t = remove_pointer_t<remove_reference_t<T>>

Definition at line 78 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 T>

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

Definition at line 104 of file pair.hpp.

## ◆ type [2/5]

template<typename T>

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

Definition at line 109 of file pair.hpp.

## ◆ type [3/5]

template<typename T>

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

Definition at line 129 of file pair.hpp.

## ◆ type [4/5]

template<typename T>

using flecs::base_type< T >::type = decay_t< actual_type_t<T> >

Definition at line 119 of file pair.hpp.

## ◆ type [5/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.

## 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>

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 139 of file pair.hpp.

## ◆ value [2/2]

template<typename T>

bool flecs::is_pair< T >::value = is_base_of<_::pair_base, raw_type_t<T> >::value
| staticconstexpr

Definition at line 83 of file pair.hpp.