From 1b44133b683387eb1f58c63401f7fe089fa2a118 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sun, 23 Oct 2022 19:49:22 +0100 Subject: [PATCH] Reordered member initialisation --- include/etl/optional.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/etl/optional.h b/include/etl/optional.h index cc38724b..9370b536 100644 --- a/include/etl/optional.h +++ b/include/etl/optional.h @@ -510,8 +510,8 @@ namespace etl private: - typename etl::aligned_storage_as::type storage; bool valid; + typename etl::aligned_storage_as::type storage; }; //***************************************************************************** @@ -526,8 +526,8 @@ namespace etl /// Constructor. //*************************************************************************** ETL_CONSTEXPR14 optional() - : storage() - , valid(false) + : valid(false) + , storage() { } @@ -535,8 +535,8 @@ namespace etl /// Constructor with nullopt. //*************************************************************************** ETL_CONSTEXPR14 optional(etl::nullopt_t) - : storage() - , valid(false) + : valid(false) + , storage() { } @@ -564,8 +564,8 @@ namespace etl /// Constructor from value type. //*************************************************************************** ETL_CONSTEXPR14 optional(const T& value_) - : storage(value_) - , valid(true) + : valid(true) + , storage(value_) { } @@ -574,8 +574,8 @@ namespace etl /// Constructor from value type. //*************************************************************************** ETL_CONSTEXPR14 optional(T&& value_) - : storage(etl::move(value_)) - , valid(true) + : valid(true) + , storage(etl::move(value_)) { } #endif @@ -821,8 +821,8 @@ namespace etl private: - T storage; bool valid; + T storage; }; //*************************************************************************** @@ -1164,7 +1164,7 @@ namespace etl //*************************************************************************** #if ETL_CPP17_SUPPORTED template - etl::optional(T) -> etl::optional; + optional(T) -> optional; #endif }