Trivial borrowed container handle; never owns or deletes the container.
More...
#include <StormByte/multimedia/typedefs.hxx>
|
| constexpr | ContainerRef () noexcept=default |
| | Constructs an empty handle.
|
| constexpr | ContainerRef (const Container &container) noexcept |
| | Borrows a container.
|
| constexpr | ContainerRef (const ContainerRef &other) noexcept=default |
| | Copies the borrowed pointer.
|
| constexpr | ContainerRef (ContainerRef &&other) noexcept=default |
| | Copies the borrowed pointer without clearing the source.
|
| | ~ContainerRef () noexcept=default |
| | Destroys the handle, not its container.
|
| constexpr ContainerRef & | operator= (const ContainerRef &other) noexcept=default |
| | Copies the borrowed pointer.
|
| constexpr ContainerRef & | operator= (ContainerRef &&other) noexcept=default |
| | Copies the borrowed pointer without clearing the source.
|
| constexpr | operator bool () const noexcept |
| | Tests whether a container is borrowed.
|
| constexpr const Container & | get () const noexcept |
| | Gets the borrowed container, preserving reference_wrapper syntax.
|
| constexpr | operator const Container & () const noexcept |
| | Converts to the borrowed container reference.
|
Trivial borrowed container handle; never owns or deletes the container.
- Note
- The container must outlive every handle. Registry handles are valid until registry teardown, with the provider loaded and a compatible compiler, standard-library ABI and provider layout. Empty handles cannot be dereferenced.
◆ ContainerRef() [1/4]
| StormByte::Multimedia::ContainerRef::ContainerRef |
( |
| ) |
|
|
constexprdefaultnoexcept |
Constructs an empty handle.
◆ ContainerRef() [2/4]
| StormByte::Multimedia::ContainerRef::ContainerRef |
( |
const Container & | container | ) |
|
|
inlineconstexprnoexcept |
Borrows a container.
- Parameters
-
| container | Container that must outlive the handle. |
◆ ContainerRef() [3/4]
| StormByte::Multimedia::ContainerRef::ContainerRef |
( |
const ContainerRef & | other | ) |
|
|
constexprdefaultnoexcept |
Copies the borrowed pointer.
- Parameters
-
◆ ContainerRef() [4/4]
| StormByte::Multimedia::ContainerRef::ContainerRef |
( |
ContainerRef && | other | ) |
|
|
constexprdefaultnoexcept |
Copies the borrowed pointer without clearing the source.
- Parameters
-
◆ ~ContainerRef()
| StormByte::Multimedia::ContainerRef::~ContainerRef |
( |
| ) |
|
|
defaultnoexcept |
Destroys the handle, not its container.
◆ get()
| const Container & StormByte::Multimedia::ContainerRef::get |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Gets the borrowed container, preserving reference_wrapper syntax.
- Precondition
- The handle is nonempty and its container is alive.
- Returns
- Borrowed container.
◆ operator bool()
| StormByte::Multimedia::ContainerRef::operator bool |
( |
| ) |
const |
|
inlineexplicitconstexprnoexcept |
Tests whether a container is borrowed.
- Returns
- True for a nonempty handle.
◆ operator const Container &()
| StormByte::Multimedia::ContainerRef::operator const Container & |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Converts to the borrowed container reference.
- Precondition
- The handle is nonempty and its container is alive.
- Returns
- Borrowed container.
◆ operator=() [1/2]
Copies the borrowed pointer.
- Parameters
-
- Returns
- This handle.
◆ operator=() [2/2]
Copies the borrowed pointer without clearing the source.
- Parameters
-
- Returns
- This handle.
The documentation for this class was generated from the following file: