Skip to content

Commit 41adcc6

Browse files
author
John Wellbelove
committed
Sync to ETL 20.38.17
1 parent c84db96 commit 41adcc6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+7448
-4259
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Embedded Template Library ETL",
3-
"version": "20.38.11",
3+
"version": "20.38.17",
44
"authors": {
55
"name": "John Wellbelove",
66
"email": "[email protected]"

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Embedded Template Library ETL
2-
version=20.38.11
2+
version=20.38.17
33
author= John Wellbelove <[email protected]>
44
maintainer=John Wellbelove <[email protected]>
55
license=MIT

src/etl/absolute.h

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ namespace etl
4040
// For signed types.
4141
//***************************************************************************
4242
template <typename T>
43-
ETL_CONSTEXPR typename etl::enable_if<etl::is_signed<T>::value, T>::type
44-
absolute(T value)
43+
ETL_NODISCARD
44+
ETL_CONSTEXPR
45+
typename etl::enable_if<etl::is_signed<T>::value, T>::type
46+
absolute(T value) ETL_NOEXCEPT
4547
{
4648
return (value < T(0)) ? -value : value;
4749
}
@@ -50,8 +52,10 @@ namespace etl
5052
// For unsigned types.
5153
//***************************************************************************
5254
template <typename T>
53-
ETL_CONSTEXPR typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
54-
absolute(T value)
55+
ETL_NODISCARD
56+
ETL_CONSTEXPR
57+
typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
58+
absolute(T value) ETL_NOEXCEPT
5559
{
5660
return value;
5761
}
@@ -65,8 +69,10 @@ namespace etl
6569
#else
6670
template <typename T, typename TReturn>
6771
#endif
68-
ETL_CONSTEXPR typename etl::enable_if<etl::is_signed<T>::value, TReturn>::type
69-
absolute_unsigned(T value)
72+
ETL_NODISCARD
73+
ETL_CONSTEXPR
74+
typename etl::enable_if<etl::is_signed<T>::value, TReturn>::type
75+
absolute_unsigned(T value) ETL_NOEXCEPT
7076
{
7177
return (value == etl::integral_limits<T>::min) ? (etl::integral_limits<TReturn>::max / 2U) + 1U
7278
: (value < T(0)) ? TReturn(-value) : TReturn(value);
@@ -77,8 +83,10 @@ namespace etl
7783
// Returns the result as the unsigned type.
7884
//***************************************************************************
7985
template <typename T>
80-
ETL_CONSTEXPR typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
81-
absolute_unsigned(T value)
86+
ETL_NODISCARD
87+
ETL_CONSTEXPR
88+
typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
89+
absolute_unsigned(T value) ETL_NOEXCEPT
8290
{
8391
return etl::absolute(value);
8492
}

0 commit comments

Comments
 (0)