Skip to content

Commit

Permalink
Sync to ETL 20.38.17
Browse files Browse the repository at this point in the history
  • Loading branch information
John Wellbelove committed Jul 28, 2024
1 parent c84db96 commit 41adcc6
Show file tree
Hide file tree
Showing 92 changed files with 7,448 additions and 4,259 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Embedded Template Library ETL",
"version": "20.38.11",
"version": "20.38.17",
"authors": {
"name": "John Wellbelove",
"email": "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Embedded Template Library ETL
version=20.38.11
version=20.38.17
author= John Wellbelove <[email protected]>
maintainer=John Wellbelove <[email protected]>
license=MIT
Expand Down
24 changes: 16 additions & 8 deletions src/etl/absolute.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ namespace etl
// For signed types.
//***************************************************************************
template <typename T>
ETL_CONSTEXPR typename etl::enable_if<etl::is_signed<T>::value, T>::type
absolute(T value)
ETL_NODISCARD
ETL_CONSTEXPR
typename etl::enable_if<etl::is_signed<T>::value, T>::type
absolute(T value) ETL_NOEXCEPT
{
return (value < T(0)) ? -value : value;
}
Expand All @@ -50,8 +52,10 @@ namespace etl
// For unsigned types.
//***************************************************************************
template <typename T>
ETL_CONSTEXPR typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
absolute(T value)
ETL_NODISCARD
ETL_CONSTEXPR
typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
absolute(T value) ETL_NOEXCEPT
{
return value;
}
Expand All @@ -65,8 +69,10 @@ namespace etl
#else
template <typename T, typename TReturn>
#endif
ETL_CONSTEXPR typename etl::enable_if<etl::is_signed<T>::value, TReturn>::type
absolute_unsigned(T value)
ETL_NODISCARD
ETL_CONSTEXPR
typename etl::enable_if<etl::is_signed<T>::value, TReturn>::type
absolute_unsigned(T value) ETL_NOEXCEPT
{
return (value == etl::integral_limits<T>::min) ? (etl::integral_limits<TReturn>::max / 2U) + 1U
: (value < T(0)) ? TReturn(-value) : TReturn(value);
Expand All @@ -77,8 +83,10 @@ namespace etl
// Returns the result as the unsigned type.
//***************************************************************************
template <typename T>
ETL_CONSTEXPR typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
absolute_unsigned(T value)
ETL_NODISCARD
ETL_CONSTEXPR
typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
absolute_unsigned(T value) ETL_NOEXCEPT
{
return etl::absolute(value);
}
Expand Down
Loading

0 comments on commit 41adcc6

Please sign in to comment.