Storage for a moved object that is retrieved by reference. More...
Public Member Functions | |
| moved_ref_storage (T &&t, void *const base, std::size_t &size) noexcept | |
Constructs a new object by packing t in it. More... | |
| template<typename Tuple > | |
| moved_ref_storage (Tuple &&t) noexcept | |
Packs the object contained in tuple t. More... | |
| moved_ref_storage (moved_ref_storage const &)=delete | |
| moved_ref_storage & | operator= (moved_ref_storage const &)=delete |
| T & | get (void *const base) |
| Returns the stored object after unpacking it. More... | |
| T & | get (void *const base, std::size_t &size) |
| Returns the stored object after unpacking it. More... | |
Static Public Member Functions | |
| static std::size_t | packed_size (T &&t) noexcept |
Returns the packed size of t. More... | |
Storage for a moved object that is retrieved by reference.
| T | Object type. |
During unpacking, a new object is copy constructed from the stored object if the move has failed and returned by reference. The copy constructed object is deleted when the destructor is called.
|
noexcept |
Constructs a new object by packing t in it.
This constructor will copy the dynamic part of the object at base + size, which should be big enough to fit it.
| t | Object to pack. |
| base | Pointer to buffer start where the dynamic part of t can be stored in. |
| size | Offset from base where space is available. |
|
noexcept |
Packs the object contained in tuple t.
| t | Tuple with the object to pack, the start of the buffer for the dynamic part of the object and the offset from the start of the buffer. |
|
staticnoexcept |
Returns the packed size of t.
| T& stapl::runtime::moved_ref_storage< T >::get | ( | void *const | base | ) |
Returns the stored object after unpacking it.
| base | Buffer where the dynamic part of the object is stored. |
| T& stapl::runtime::moved_ref_storage< T >::get | ( | void *const | base, |
| std::size_t & | size | ||
| ) |
Returns the stored object after unpacking it.
| base | Buffer where the dynamic part of the object is stored. |
| size | Variable to store how many bytes were unpacked. |
1.8.13