mirror of
https://github.com/ETLCPP/etl.git
synced 2026-10-28 18:07:10 +08:00
Fixed reference return instead of pointer.
This commit is contained in:
parent
24754127c8
commit
fc61e9b89b
@ -141,7 +141,7 @@ namespace etl
|
||||
|
||||
/// Get address as T reference.
|
||||
template <typename T>
|
||||
T* get_reference()
|
||||
T& get_reference()
|
||||
{
|
||||
STATIC_ASSERT(ALIGNMENT % etl::alignment_of<T>::value == 0, "Incompatible alignment");
|
||||
return reinterpret_cast<T&>(*data);
|
||||
@ -149,7 +149,7 @@ namespace etl
|
||||
|
||||
/// Get address as const T reference.
|
||||
template <typename T>
|
||||
const T* get_reference() const
|
||||
const T& get_reference() const
|
||||
{
|
||||
STATIC_ASSERT(ALIGNMENT % etl::alignment_of<T>::value == 0, "Incompatible alignment");
|
||||
return reinterpret_cast<const T&>(*data);
|
||||
@ -174,7 +174,7 @@ namespace etl
|
||||
union
|
||||
{
|
||||
uint8_t data[LENGTH];
|
||||
typename etl::type_with_alignment<ALIGNMENT>::type __etl_alignment_type__; // A POD type has has the same alignment as ALIGNMENT.
|
||||
typename etl::type_with_alignment<ALIGNMENT>::type __etl_alignment_type__; // A POD type that has the same alignment as ALIGNMENT.
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user