mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Allow etl::type_def to be trivially copyable
This commit is contained in:
parent
b28c485d1a
commit
c842e807ef
@ -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()
|
||||
|
||||
@ -51,6 +51,7 @@ namespace
|
||||
uint32_t i2 = t2.get();
|
||||
|
||||
CHECK_EQUAL(i1, i2);
|
||||
CHECK_TRUE(std::is_trivially_copyable<type1_t>::value);
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user