Expression Templates Library (ETL)
Public Member Functions | Public Attributes | List of all members
etl::aligned_ptr< T, S > Struct Template Reference

RAII wrapper for allocated aligned memory. More...

#include <allocator.hpp>

Public Member Functions

 aligned_ptr (T *ptr)
 Build an aligned_ptr managing the given pointer.
 
 aligned_ptr (const aligned_ptr &rhs)=delete
 
aligned_ptroperator= (const aligned_ptr &rhs)=delete
 
 aligned_ptr (aligned_ptr &&rhs) noexcept
 Move construct an aligned_ptr. More...
 
aligned_ptroperator= (aligned_ptr &&rhs) noexcept
 Move assign an aligned_ptr. More...
 
T & operator[] (size_t i)
 Returns a reference to the element at psition i.
 
const T & operator[] (size_t i) const
 Returns a reference to the element at psition i.
 
 ~aligned_ptr ()
 Destruct the aligned_ptr and release the aligned memory.
 
T * get ()
 Returns the raw underlying pointer.
 

Public Attributes

T * ptr
 The raw pointer.
 

Detailed Description

template<typename T, size_t S = sizeof(T)>
struct etl::aligned_ptr< T, S >

RAII wrapper for allocated aligned memory.

Constructor & Destructor Documentation

◆ aligned_ptr()

template<typename T , size_t S = sizeof(T)>
etl::aligned_ptr< T, S >::aligned_ptr ( aligned_ptr< T, S > &&  rhs)
inlinenoexcept

Move construct an aligned_ptr.

Parameters
rhsThe pointer to move

Member Function Documentation

◆ operator=()

template<typename T , size_t S = sizeof(T)>
aligned_ptr& etl::aligned_ptr< T, S >::operator= ( aligned_ptr< T, S > &&  rhs)
inlinenoexcept

Move assign an aligned_ptr.

Parameters
rhsThe pointer to move
Returns
the aligned_ptr

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