uvcc
libuv C++ bindings
uv::aligned_storage< _LEN_, _ALIGN_ > Class Template Reference

A wrapper around std::aligned_storage< _LEN_, _ALIGN_ >::type that simplifies initializing the provided storage space, getting from it, setting it to, and automatic destroying it from objects of any type fitting to the given size and alignment requirements. More...

#include "utility.hpp"

Public Member Functions

 aligned_storage ()=default
 Create an uninitialized storage.
 
 aligned_storage (const aligned_storage &)=delete
 
aligned_storageoperator= (const aligned_storage &)=delete
 
 aligned_storage (aligned_storage &&)=delete
 
aligned_storageoperator= (aligned_storage &&)=delete
 
template<typename _T_ >
 aligned_storage (const _T_ &_value)
 Create a storage space with a copy-initialized value from the specified one.
 
template<typename _T_ >
 aligned_storage (_T_ &&_value)
 Create a storage space with a move-initialized value from the specified value.
 
const std::type_infotag () const noexcept
 The type tag of the stored value. More...
 
 operator bool () const noexcept
 Equivalent to (tag() != nullptr).
 
Functions to reinitialize the storage space:
Note
The previously stored value is destroyed.
template<typename _T_ >
void reset ()
 Reinitialize the storage space with a default value of the specified type.
 
template<typename _T_ , typename... _Args_>
void reset (_Args_ &&... _args)
 Ditto but the value is created from the arguments forwarded to the type constructor.
 
template<typename _T_ >
void reset (const _T_ &_value)
 Ditto but the value is copy-created from the specified argument.
 
template<typename _T_ >
void reset (_T_ &&_value)
 Ditto but the value is move-created from the specified argument.
 
Functions to get the value that this storage space is holding:
template<typename _T_ >
const std::decay< _T_ >::type & get () const noexcept
 
template<typename _T_ >
std::decay< _T_ >::type & get () noexcept
 

Detailed Description

template<std::size_t _LEN_, std::size_t _ALIGN_>
class uv::aligned_storage< _LEN_, _ALIGN_ >

A wrapper around std::aligned_storage< _LEN_, _ALIGN_ >::type that simplifies initializing the provided storage space, getting from it, setting it to, and automatic destroying it from objects of any type fitting to the given size and alignment requirements.

Note
All the member functions creating a new value in the storage from their arguments use the curly brace initialization.

Definition at line 339 of file utility.hpp.

Member Function Documentation

◆ tag()

template<std::size_t _LEN_, std::size_t _ALIGN_>
const std::type_info* uv::aligned_storage< _LEN_, _ALIGN_ >::tag ( ) const
inlinenoexcept

The type tag of the stored value.

It's just a pointer referring to the static global constant object returned by the typeid() operator for the type of the value currently stored in this variable. nullptr is returned if the storage space is not initialized and is not holding any value.

Definition at line 463 of file utility.hpp.


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