Flecs: flecs::pair< First, Second > Struct Template Reference
Description: A fast entity component system (ECS) for C & C++

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

Loading...
Searching...
No Matches
flecs::pair< First, Second > Struct Template Reference
C++ API » Core » Pair type

Type that represents a pair. More...

`#include <pair.hpp>`

Inheritance diagram for flecs::pair< First, Second >:
[legend]

## Public Types
using | type = conditional_t<!is_empty<First>::value || is_empty<Second>::value, First, Second>
using | first = First
using | second = Second

## Public Member Functions
| pair (type &v)
| pair (const type &v)
| operator type & ()
| operator const type & () const
type * | operator-> ()
const type * | operator-> () const
type & | operator* ()
const type & | operator* () const

## Detailed Description

template<typename First, typename Second>
struct flecs::pair< First, Second >

Type that represents a pair.

The pair type can be used to represent a pair at compile time, and is able to automatically derive the storage type associated with the pair, accessible through pair::type.

The storage type is derived using the following rules:

- if pair::first is non-empty, the storage type is pair::first
- if pair::first is empty and pair::second is non-empty, the storage type is pair::second

The pair type can hold a temporary value so that it can be used in the signatures of queries

Definition at line 36 of file pair.hpp.

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

- include/flecs/addons/cpp/pair.hpp