Allow etl::type_def to be trivially copyable

This commit is contained in:
John Wellbelove 2024-12-26 13:12:11 +00:00
parent b28c485d1a
commit c842e807ef
2 changed files with 10 additions and 13 deletions

View File

@ -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()

View File

@ -51,6 +51,7 @@ namespace
uint32_t i2 = t2.get();
CHECK_EQUAL(i1, i2);
CHECK_TRUE(std::is_trivially_copyable<type1_t>::value);
}
//*************************************************************************