Update vector.h to handle C++11 (#109)

* Merge remote-tracking branch 'origin/development'

* Update vector.h to handle C++11
This commit is contained in:
Bo Rydberg 2019-01-06 18:29:07 +01:00 committed by John Wellbelove
parent 4b7d832590
commit aa3996b38d
2 changed files with 13 additions and 0 deletions

View File

@ -534,6 +534,17 @@ namespace etl
return *reinterpret_cast<T*>(p);
}
//*****************************************************************************
/// Construct an item at address p.
///\ingroup memory
//*****************************************************************************
template <typename T, typename TParameter>
T& make_value_at(T* p, TParameter&& value)
{
::new (p) T(std::move(value));
return *reinterpret_cast<T*>(p);
}
//*****************************************************************************
/// Construct an item at address p.
///\ingroup memory

View File

@ -85,7 +85,9 @@ namespace etl
typedef T value_type;
typedef T& reference;
typedef const T& const_reference;
#if ETL_CPP11_SUPPORTED
typedef T&& rvalue_reference;
#endif
typedef T* pointer;
typedef const T* const_pointer;
typedef T* iterator;