diff --git a/include/etl/memory.h b/include/etl/memory.h index c1000b9e..05f8e94a 100644 --- a/include/etl/memory.h +++ b/include/etl/memory.h @@ -534,6 +534,17 @@ namespace etl return *reinterpret_cast(p); } + //***************************************************************************** + /// Construct an item at address p. + ///\ingroup memory + //***************************************************************************** + template + T& make_value_at(T* p, TParameter&& value) + { + ::new (p) T(std::move(value)); + return *reinterpret_cast(p); + } + //***************************************************************************** /// Construct an item at address p. ///\ingroup memory diff --git a/include/etl/vector.h b/include/etl/vector.h index 8b3cf069..43eff53c 100644 --- a/include/etl/vector.h +++ b/include/etl/vector.h @@ -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;