From d60dc6e05e559a3e8e5987e847ba1ed7c608f7d3 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Mon, 11 Feb 2019 10:51:11 +0100 Subject: [PATCH] Added NO_EXCEPT macros. Added std::forward to alternate 'No STL' utility header. --- include/etl/platform.h | 8 ++++++++ include/etl/stl/alternate/utility.h | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/etl/platform.h b/include/etl/platform.h index cab27d25..0a0e09f1 100644 --- a/include/etl/platform.h +++ b/include/etl/platform.h @@ -94,4 +94,12 @@ SOFTWARE. #define ETL_DELETE #endif +#if ETL_CPP11_SUPPORTED + #define ETL_NO_EXCEPT noexcept + #define ETL_NO_EXCEPT_EXPR(expression) noexcept(expression) +#else + #define ETL_NO_EXCEPT + #define ETL_NO_EXCEPT_EXPR(expression) +#endif + #endif diff --git a/include/etl/stl/alternate/utility.h b/include/etl/stl/alternate/utility.h index 5bdce60b..1195778b 100644 --- a/include/etl/stl/alternate/utility.h +++ b/include/etl/stl/alternate/utility.h @@ -148,11 +148,25 @@ SOFTWARE. #endif #if ETL_CPP11_SUPPORTED + //****************************************************************************** template constexpr typename etl::remove_reference::type&& move(T&& t) noexcept { return static_cast::type&&>(t); } + + //****************************************************************************** + template + constexpr T&& forward(typename etl::remove_reference::type& t) noexcept + { + return static_cast(t); + } + + template + constexpr T&& forward(typename etl::remove_reference::type&& t) noexcept + { + return static_cast(t); + } #endif }