|
EnTT 3.13.1
|
A compressed pair. More...
#include <compressed_pair.hpp>


Public Types | |
| using | first_type = First |
| The type of the first element that the pair stores. | |
| using | second_type = Second |
| The type of the second element that the pair stores. | |
Public Member Functions | |
| template<bool Dummy = true, typename = std::enable_if_t<Dummy && std::is_default_constructible_v<first_type> && std::is_default_constructible_v<second_type>>> | |
| constexpr | compressed_pair () noexcept(std::is_nothrow_default_constructible_v< first_base > &&std::is_nothrow_default_constructible_v< second_base >) |
| Default constructor, conditionally enabled. | |
| constexpr | compressed_pair (const compressed_pair &other) noexcept(std::is_nothrow_copy_constructible_v< first_base > &&std::is_nothrow_copy_constructible_v< second_base >)=default |
| Copy constructor. | |
| constexpr | compressed_pair (compressed_pair &&other) noexcept(std::is_nothrow_move_constructible_v< first_base > &&std::is_nothrow_move_constructible_v< second_base >)=default |
| Move constructor. | |
| template<typename Arg , typename Other > | |
| constexpr | compressed_pair (Arg &&arg, Other &&other) noexcept(std::is_nothrow_constructible_v< first_base, Arg > &&std::is_nothrow_constructible_v< second_base, Other >) |
| Constructs a pair from its values. | |
| template<typename... Args, typename... Other> | |
| constexpr | compressed_pair (std::piecewise_construct_t, std::tuple< Args... > args, std::tuple< Other... > other) noexcept(std::is_nothrow_constructible_v< first_base, Args... > &&std::is_nothrow_constructible_v< second_base, Other... >) |
| Constructs a pair by forwarding the arguments to its parts. | |
| constexpr compressed_pair & | operator= (const compressed_pair &other) noexcept(std::is_nothrow_copy_assignable_v< first_base > &&std::is_nothrow_copy_assignable_v< second_base >)=default |
| Copy assignment operator. | |
| constexpr compressed_pair & | operator= (compressed_pair &&other) noexcept(std::is_nothrow_move_assignable_v< first_base > &&std::is_nothrow_move_assignable_v< second_base >)=default |
| Move assignment operator. | |
| constexpr first_type & | first () noexcept |
| Returns the first element that a pair stores. | |
| constexpr const first_type & | first () const noexcept |
| Returns the first element that a pair stores. | |
| constexpr second_type & | second () noexcept |
| Returns the second element that a pair stores. | |
| constexpr const second_type & | second () const noexcept |
| Returns the second element that a pair stores. | |
| constexpr void | swap (compressed_pair &other) noexcept(std::is_nothrow_swappable_v< first_type > &&std::is_nothrow_swappable_v< second_type >) |
| Swaps two compressed pair objects. | |
| template<std::size_t Index> | |
| constexpr decltype(auto) | get () noexcept |
| Extracts an element from the compressed pair. | |
| template<std::size_t Index> | |
| constexpr decltype(auto) | get () const noexcept |
| Extracts an element from the compressed pair. | |
A compressed pair.
A pair that exploits the Empty Base Class Optimization (or EBCO) to reduce its final size to a minimum.
| First | The type of the first element that the pair stores. |
| Second | The type of the second element that the pair stores. |
Definition at line 84 of file compressed_pair.hpp.
| using entt::compressed_pair< First, Second >::first_type = First |
The type of the first element that the pair stores.
Definition at line 92 of file compressed_pair.hpp.
| using entt::compressed_pair< First, Second >::second_type = Second |
The type of the second element that the pair stores.
Definition at line 94 of file compressed_pair.hpp.
|
inlineconstexprnoexcept |
Default constructor, conditionally enabled.
This constructor is only available when the types that the pair stores are both at least default constructible.
| Dummy | Dummy template parameter used for internal purposes. |
Definition at line 105 of file compressed_pair.hpp.
|
constexprdefaultnoexcept |
Copy constructor.
| other | The instance to copy from. |
|
constexprdefaultnoexcept |
Move constructor.
| other | The instance to move from. |
|
inlineconstexprnoexcept |
Constructs a pair from its values.
| Arg | Type of value to use to initialize the first element. |
| Other | Type of value to use to initialize the second element. |
| arg | Value to use to initialize the first element. |
| other | Value to use to initialize the second element. |
Definition at line 129 of file compressed_pair.hpp.
|
inlineconstexprnoexcept |
Constructs a pair by forwarding the arguments to its parts.
| Args | Types of arguments to use to initialize the first element. |
| Other | Types of arguments to use to initialize the second element. |
| args | Arguments to use to initialize the first element. |
| other | Arguments to use to initialize the second element. |
Definition at line 141 of file compressed_pair.hpp.
|
inlineconstexprnoexcept |
Returns the first element that a pair stores.
Definition at line 168 of file compressed_pair.hpp.
|
inlineconstexprnoexcept |
Returns the first element that a pair stores.
Definition at line 163 of file compressed_pair.hpp.
|
inlineconstexprnoexcept |
Extracts an element from the compressed pair.
| Index | An integer value that is either 0 or 1. |
Index is 0 and a reference to the second element if Index is 1. Definition at line 213 of file compressed_pair.hpp.
|
inlineconstexprnoexcept |
Extracts an element from the compressed pair.
| Index | An integer value that is either 0 or 1. |
Index is 0 and a reference to the second element if Index is 1. Definition at line 202 of file compressed_pair.hpp.
|
constexprdefaultnoexcept |
Move assignment operator.
| other | The instance to move from. |
|
constexprdefaultnoexcept |
Copy assignment operator.
| other | The instance to copy from. |
|
inlineconstexprnoexcept |
Returns the second element that a pair stores.
Definition at line 181 of file compressed_pair.hpp.
|
inlineconstexprnoexcept |
Returns the second element that a pair stores.
Definition at line 176 of file compressed_pair.hpp.
|
inlineconstexprnoexcept |
Swaps two compressed pair objects.
| other | The compressed pair to swap with. |
Definition at line 189 of file compressed_pair.hpp.