Embedded Template Library 1.0
|
Allows an arithmetic type to be stored at an unaligned address. More...
#include <unaligned_type.h>
Public Member Functions | |
ETL_STATIC_ASSERT (etl::is_integral< T >::value||etl::is_floating_point< T >::value, "Unaligned type must be integral or floating point") | |
ETL_CONSTEXPR | unaligned_type () |
Default constructor. | |
ETL_CONSTEXPR14 | unaligned_type (T value) |
Construct from a value. | |
template<int Endian_Other> | |
ETL_CONSTEXPR14 | unaligned_type (const unaligned_type< T, Endian_Other > &other) |
Copy constructor. | |
ETL_CONSTEXPR14 unaligned_type & | operator= (T value) |
Assignment operator. | |
template<int Endian_Other> | |
ETL_CONSTEXPR14 unaligned_type & | operator= (const unaligned_type< T, Endian_Other > &other) |
Assignment operator from other endianness. | |
ETL_CONSTEXPR14 | operator T () const |
Conversion operator. | |
ETL_CONSTEXPR14 T | value () const |
Get the value. | |
![]() | |
ETL_CONSTEXPR | unaligned_type_common () |
Default constructor. | |
ETL_CONSTEXPR size_t | size () const |
Size of the storage. | |
pointer | data () |
Pointer to the beginning of the storage. | |
ETL_CONSTEXPR const_pointer | data () const |
Const pointer to the beginning of the storage. | |
iterator | begin () |
Iterator to the beginning of the storage. | |
ETL_CONSTEXPR const_iterator | begin () const |
Const iterator to the beginning of the storage. | |
ETL_CONSTEXPR const_iterator | cbegin () const |
Const iterator to the beginning of the storage. | |
reverse_iterator | rbegin () |
Reverse iterator to the beginning of the storage. | |
ETL_CONSTEXPR14 const_reverse_iterator | rbegin () const |
Const reverse iterator to the beginning of the storage. | |
ETL_CONSTEXPR14 const_reverse_iterator | crbegin () const |
Const reverse iterator to the beginning of the storage. | |
iterator | end () |
Iterator to the end of the storage. | |
ETL_CONSTEXPR const_iterator | end () const |
Const iterator to the end of the storage. | |
ETL_CONSTEXPR const_iterator | cend () const |
Const iterator to the end of the storage. | |
reverse_iterator | rend () |
Reverse iterator to the end of the storage. | |
ETL_CONSTEXPR14 const_reverse_iterator | rend () const |
Const reverse iterator to the end of the storage. | |
ETL_CONSTEXPR14 const_reverse_iterator | crend () const |
Const reverse iterator to the end of the storage. | |
storage_type & | operator[] (int i) |
Index operator. | |
ETL_CONSTEXPR const storage_type & | operator[] (int i) const |
Const index operator. | |
Static Public Attributes | |
static ETL_CONSTANT int | Endian = Endian_ |
static ETL_CONSTANT size_t | Size = private_unaligned_type::unaligned_type_common<sizeof(T)>::Size |
![]() | |
static ETL_CONSTANT size_t | Size |
Additional Inherited Members | |
![]() | |
unsigned char | storage [Size] |
Allows an arithmetic type to be stored at an unaligned address.
T | The arithmetic type. |
Endian | The endianness of the arithmetic type. |