mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 22:59:47 +08:00
Made destructor compatible with C++03
This commit is contained in:
parent
400d6d7da0
commit
130859c3b7
@ -378,16 +378,8 @@ namespace etl
|
||||
/// Default destructor which will NOT call the destructor of the object which
|
||||
/// was created by calling create().
|
||||
//***************************************************************************
|
||||
~typed_storage() = default;
|
||||
|
||||
//***************************************************************************
|
||||
/// Calls the destructor of the wrapped object and asserts if has_value() is false.
|
||||
//***************************************************************************
|
||||
void destroy()
|
||||
~typed_storage()
|
||||
{
|
||||
ETL_ASSERT(has_value(), ETL_ERROR(etl::typed_storage_error));
|
||||
data.template get_reference<T>().~T();
|
||||
valid = false;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
@ -471,6 +463,16 @@ namespace etl
|
||||
}
|
||||
#endif
|
||||
|
||||
//***************************************************************************
|
||||
/// Calls the destructor of the wrapped object and asserts if has_value() is false.
|
||||
//***************************************************************************
|
||||
void destroy()
|
||||
{
|
||||
ETL_ASSERT(has_value(), ETL_ERROR(etl::typed_storage_error));
|
||||
data.template get_reference<T>().~T();
|
||||
valid = false;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
/// \returns a pointer of type T and asserts if has_value() is false.
|
||||
//***************************************************************************
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user