diff --git a/include/etl/type_def.h b/include/etl/type_def.h index c124aa7e..cdd916e7 100644 --- a/include/etl/type_def.h +++ b/include/etl/type_def.h @@ -58,10 +58,9 @@ namespace etl typedef TIdType id_type; //********************************************************************* - ETL_CONSTEXPR type_def() - : value(TValue()) - { - } +#if ETL_USING_CPP11 + ETL_CONSTEXPR type_def() = default; +#endif //********************************************************************* ETL_CONSTEXPR type_def(TValue value_) @@ -70,10 +69,9 @@ namespace etl } //********************************************************************* - ETL_CONSTEXPR type_def(const type_def& other) - : value(other.value) - { - } +#if ETL_USING_CPP11 + ETL_CONSTEXPR type_def(const type_def& other) = default; +#endif //********************************************************************* ETL_CONSTEXPR operator TValue() const @@ -245,11 +243,9 @@ namespace etl } //********************************************************************* - ETL_CONSTEXPR14 type_def& operator =(const type_def& rhs) - { - value = rhs.value; - return *this; - } +#if ETL_USING_CPP11 + ETL_CONSTEXPR14 type_def& operator =(const type_def& rhs) = default; +#endif //********************************************************************* TValue& get() diff --git a/test/test_type_def.cpp b/test/test_type_def.cpp index b30278a9..f42b593b 100644 --- a/test/test_type_def.cpp +++ b/test/test_type_def.cpp @@ -51,6 +51,7 @@ namespace uint32_t i2 = t2.get(); CHECK_EQUAL(i1, i2); + CHECK_TRUE(std::is_trivially_copyable::value); } //*************************************************************************