From 338164d871ed810ef12a8c6b31f4727a92507a02 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sat, 29 Dec 2018 20:47:17 +0000 Subject: [PATCH] Added conditional compile directives for C++11 --- include/etl/memory.h | 4 ++++ include/etl/vector.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/include/etl/memory.h b/include/etl/memory.h index 0f6df281..b063dc1a 100644 --- a/include/etl/memory.h +++ b/include/etl/memory.h @@ -417,6 +417,7 @@ namespace etl ::new (p) T(value); } +#if ETL_CPP11_SUPPORTED //***************************************************************************** /// Copy construct an item at address p. ///\ingroup memory @@ -426,6 +427,7 @@ namespace etl { ::new (p) T(std::move(value)); } +#endif //***************************************************************************** /// Copy construct an item at address p. @@ -472,6 +474,7 @@ namespace etl return *reinterpret_cast(p); } +#if ETL_CPP11_SUPPORTED //***************************************************************************** /// Construct an item at address p. ///\ingroup memory @@ -482,6 +485,7 @@ namespace etl ::new (p) T(std::move(other)); return *reinterpret_cast(p); } +#endif //***************************************************************************** /// Construct an item at address p. diff --git a/include/etl/vector.h b/include/etl/vector.h index fd5cc855..99641b0e 100644 --- a/include/etl/vector.h +++ b/include/etl/vector.h @@ -413,6 +413,7 @@ namespace etl create_back(value); } +#if ETL_CPP11_SUPPORTED //********************************************************************* /// Inserts a value at the end of the vector. /// If asserts or exceptions are enabled, emits vector_full if the vector is already full. @@ -425,6 +426,7 @@ namespace etl #endif create_back(std::move(value)); } +#endif #if ETL_CPP11_SUPPORTED && !defined(ETL_STLPORT) && !defined(ETL_NO_STL) && !ETL_VECTOR_FORCE_CPP03 //********************************************************************* @@ -544,6 +546,7 @@ namespace etl return position; } +#if ETL_CPP11_SUPPORTED //********************************************************************* /// Inserts a value to the vector. /// If asserts or exceptions are enabled, emits vector_full if the vector is already full. @@ -567,6 +570,7 @@ namespace etl return position; } +#endif //************************************************************************* /// Emplaces a value to the vextor at the specified position. @@ -965,6 +969,7 @@ namespace etl ++p_end; } +#if ETL_CPP11_SUPPORTED //********************************************************************* /// Create a new element with a value at the back //********************************************************************* @@ -975,6 +980,7 @@ namespace etl ++p_end; } +#endif //********************************************************************* /// Destroy an element at the back.