From fc61e9b89bda449d346d6afac38e3074485b12c5 Mon Sep 17 00:00:00 2001 From: jwellbelove Date: Sat, 28 Mar 2015 12:47:39 +0000 Subject: [PATCH] Fixed reference return instead of pointer. --- alignment.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/alignment.h b/alignment.h index 2b143e8e..cd51528c 100644 --- a/alignment.h +++ b/alignment.h @@ -141,7 +141,7 @@ namespace etl /// Get address as T reference. template - T* get_reference() + T& get_reference() { STATIC_ASSERT(ALIGNMENT % etl::alignment_of::value == 0, "Incompatible alignment"); return reinterpret_cast(*data); @@ -149,7 +149,7 @@ namespace etl /// Get address as const T reference. template - const T* get_reference() const + const T& get_reference() const { STATIC_ASSERT(ALIGNMENT % etl::alignment_of::value == 0, "Incompatible alignment"); return reinterpret_cast(*data); @@ -174,7 +174,7 @@ namespace etl union { uint8_t data[LENGTH]; - typename etl::type_with_alignment::type __etl_alignment_type__; // A POD type has has the same alignment as ALIGNMENT. + typename etl::type_with_alignment::type __etl_alignment_type__; // A POD type that has the same alignment as ALIGNMENT. }; }; };