Skip to content

Commit

Permalink
Sync to 20.39.4
Browse files Browse the repository at this point in the history
  • Loading branch information
John Wellbelove committed Sep 7, 2024
1 parent aa103b0 commit 97d1ba9
Show file tree
Hide file tree
Showing 46 changed files with 801 additions and 281 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.39.0",
"version": "20.39.4",
"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.39.0
version=20.39.4
author= John Wellbelove <[email protected]>
maintainer=John Wellbelove <[email protected]>
license=MIT
Expand Down
2 changes: 2 additions & 0 deletions src/etl/algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ namespace etl
//***************************************************************************
// Pointers
template <typename TIterator>
ETL_CONSTEXPR14
typename etl::enable_if<etl::is_pointer<TIterator>::value, void>::type
reverse(TIterator b, TIterator e)
{
Expand All @@ -357,6 +358,7 @@ namespace etl

// Non-pointers
template <typename TIterator>
ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_pointer<TIterator>::value, void>::type
reverse(TIterator b, TIterator e)
{
Expand Down
2 changes: 1 addition & 1 deletion src/etl/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ namespace etl
template <typename T, typename... TValues>
constexpr auto make_array(TValues&&... values) -> etl::array<T, sizeof...(TValues)>
{
return { { etl::forward<T>(values)... } };
return { etl::forward<T>(values)... };
}
#endif

Expand Down
14 changes: 7 additions & 7 deletions src/etl/base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ SOFTWARE.
#ifndef ETL_BASE64_INCLUDED
#define ETL_BASE64_INCLUDED

#include "etl/platform.h"
#include "etl/static_assert.h"
#include "etl/exception.h"
#include "etl/error_handler.h"
#include "etl/type_traits.h"
#include "etl/enum_type.h"
#include "etl/integral_limits.h"
#include "platform.h"
#include "static_assert.h"
#include "exception.h"
#include "error_handler.h"
#include "type_traits.h"
#include "enum_type.h"
#include "integral_limits.h"

#include <stdint.h>

Expand Down
26 changes: 13 additions & 13 deletions src/etl/base64_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ SOFTWARE.
#ifndef ETL_BASE64_DECODER_INCLUDED
#define ETL_BASE64_DECODER_INCLUDED

#include "etl/platform.h"
#include "etl/static_assert.h"
#include "etl/error_handler.h"
#include "etl/type_traits.h"
#include "etl/binary.h"
#include "etl/algorithm.h"
#include "etl/integral_limits.h"
#include "etl/iterator.h"
#include "etl/enum_type.h"
#include "etl/delegate.h"
#include "etl/span.h"

#include "etl/base64.h"
#include "platform.h"
#include "static_assert.h"
#include "error_handler.h"
#include "type_traits.h"
#include "binary.h"
#include "algorithm.h"
#include "integral_limits.h"
#include "iterator.h"
#include "enum_type.h"
#include "delegate.h"
#include "span.h"

#include "base64.h"

#include <stdint.h>

Expand Down
26 changes: 13 additions & 13 deletions src/etl/base64_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ SOFTWARE.
#ifndef ETL_BASE64_ENCODER_INCLUDED
#define ETL_BASE64_ENCODER_INCLUDED

#include "etl/platform.h"
#include "etl/static_assert.h"
#include "etl/error_handler.h"
#include "etl/type_traits.h"
#include "etl/binary.h"
#include "etl/algorithm.h"
#include "etl/integral_limits.h"
#include "etl/iterator.h"
#include "etl/enum_type.h"
#include "etl/delegate.h"
#include "etl/span.h"

#include "etl/base64.h"
#include "platform.h"
#include "static_assert.h"
#include "error_handler.h"
#include "type_traits.h"
#include "binary.h"
#include "algorithm.h"
#include "integral_limits.h"
#include "iterator.h"
#include "enum_type.h"
#include "delegate.h"
#include "span.h"

#include "base64.h"

#include <stdint.h>

Expand Down
2 changes: 1 addition & 1 deletion src/etl/deque.h
Original file line number Diff line number Diff line change
Expand Up @@ -2545,7 +2545,7 @@ namespace etl
template <typename T, typename... TValues>
constexpr auto make_deque(TValues&&... values) -> etl::deque<T, sizeof...(TValues)>
{
return { { etl::forward<T>(values)... } };
return { etl::forward<T>(values)... };
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/etl/flat_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ namespace etl
template <typename TKey, typename TMapped, typename TKeyCompare = etl::less<TKey>, typename... TPairs>
constexpr auto make_flat_map(TPairs&&... pairs) -> etl::flat_map<TKey, TMapped, sizeof...(TPairs), TKeyCompare>
{
return { {etl::forward<TPairs>(pairs)...} };
return { etl::forward<TPairs>(pairs)... };
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/etl/flat_multimap.h
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ namespace etl
template <typename TKey, typename TMapped, typename TKeyCompare = etl::less<TKey>, typename... TPairs>
constexpr auto make_flat_multimap(TPairs&&... pairs) -> etl::flat_multimap<TKey, TMapped, sizeof...(TPairs), TKeyCompare>
{
return { {etl::forward<TPairs>(pairs)...} };
return { etl::forward<TPairs>(pairs)... };
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/etl/flat_multiset.h
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ namespace etl
template <typename TKey, typename TKeyCompare = etl::less<TKey>, typename... T>
constexpr auto make_flat_multiset(T&&... keys) -> etl::flat_multiset<TKey, sizeof...(T), TKeyCompare>
{
return { {etl::forward<T>(keys)...} };
return { etl::forward<T>(keys)... };
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/etl/flat_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ namespace etl
template <typename TKey, typename TKeyCompare = etl::less<TKey>, typename... T>
constexpr auto make_flat_set(T&&... keys) -> etl::flat_set<TKey, sizeof...(T), TKeyCompare>
{
return { {etl::forward<T>(keys)...} };
return { etl::forward<T>(keys)... };
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/etl/forward_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,7 @@ namespace etl
template <typename... T>
constexpr auto make_forward_list(T&&... t) -> etl::forward_list<typename etl::common_type_t<T...>, sizeof...(T)>
{
return { { etl::forward<T>(t)... } };
return { etl::forward<T>(t)... };
}
#endif

Expand Down
60 changes: 56 additions & 4 deletions src/etl/generators/type_traits_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -2296,16 +2296,68 @@ typedef integral_constant<bool, true> true_type;
using signed_type_t = typename signed_type<T>::type;
#endif

//*********************************************
// type_identity
//*********************************************
// type_identity

template <typename T>
struct type_identity { typedef T type; };
template <typename T>
struct type_identity { typedef T type; };

#if ETL_USING_CPP11
template <typename T>
using type_identity_t = typename type_identity<T>::type;
#endif

#if ETL_USING_CPP11
//*********************************************
// has_duplicates
template <typename... TTypes>
struct has_duplicates;

template <typename TFirst, typename... TRest>
struct has_duplicates<TFirst, TRest...> : etl::conditional_t<etl::is_one_of<TFirst, TRest...>::value,
etl::true_type,
has_duplicates<TRest...>> {};

template <>
struct has_duplicates<> : etl::false_type {};
#endif

#if ETL_USING_CPP17
template <typename... TTypes>
inline constexpr bool has_duplicates_v = etl::has_duplicates<TTypes...>::value;
#endif

#if ETL_USING_CPP11
//*********************************************
// count_of
template <typename T, typename... TTypes>
struct count_of;

template <typename T, typename U, typename... URest>
struct count_of<T, U, URest...> : etl::integral_constant<size_t,
etl::is_same<T, U>::value +
count_of<T, URest...>::value> {};

template <typename T>
struct count_of<T> : etl::integral_constant<size_t, 0> {};
#endif

#if ETL_USING_CPP17
template <typename T, typename... TTypes>
inline constexpr size_t count_of_v = etl::count_of<T, TTypes...>::value;
#endif

#if ETL_USING_CPP11
//*********************************************
// has_duplicates_of
template <typename T, typename... TTypes>
struct has_duplicates_of : etl::bool_constant<(etl::count_of<T, TTypes...>::value > 1U)> {};
#endif

#if ETL_USING_CPP17
template <typename T, typename... TTypes>
inline constexpr bool has_duplicates_of_v = etl::has_duplicates_of<T, TTypes...>::value;
#endif
}

// Helper macros
Expand Down
4 changes: 2 additions & 2 deletions src/etl/histogram.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ namespace etl
//*********************************
value_type operator [](key_type key) const
{
return this->accumulator[key];
return this->accumulator[key - Start_Index];
}
};

Expand Down Expand Up @@ -373,7 +373,7 @@ namespace etl
//*********************************
value_type operator [](key_type key) const
{
return this->accumulator[key];
return this->accumulator[key - start_index];
}

private:
Expand Down
3 changes: 2 additions & 1 deletion src/etl/indirect_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ namespace etl
//*********************************************************************
void reserve(size_t n)
{
(void)n; // Stop 'unused parameter' warning in release mode.
ETL_ASSERT(n <= capacity(), ETL_ERROR(vector_out_of_bounds));
}

Expand Down Expand Up @@ -1469,7 +1470,7 @@ namespace etl
template <typename... T>
constexpr auto make_indirect_vector(T&&... t) -> etl::indirect_vector<typename etl::common_type_t<T...>, sizeof...(T)>
{
return { { etl::forward<T>(t)... } };
return { etl::forward<T>(t)... };
}
#endif

Expand Down
63 changes: 63 additions & 0 deletions src/etl/integral_limits.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,54 @@ namespace etl
template <typename T>
ETL_CONSTANT bool statics_char32_t<T>::is_signed;
#endif

#if ETL_USING_20BIT_TYPES
template <typename T = void>
struct statics___int20
{
typedef __int20 value_type;

static ETL_CONSTANT __int20 min = 0x80000;
static ETL_CONSTANT __int20 max = 0x7FFFF;
static ETL_CONSTANT int bits = 20;
static ETL_CONSTANT bool is_signed = true;
};

template <typename T>
ETL_CONSTANT __int20 statics___int20<T>::min;

template <typename T>
ETL_CONSTANT __int20 statics___int20<T>::max;

template <typename T>
ETL_CONSTANT int statics___int20<T>::bits;

template <typename T>
ETL_CONSTANT bool statics___int20<T>::is_signed;

template <typename T = void>
struct statics_unsigned___int20
{
typedef unsigned __int20 value_type;

static ETL_CONSTANT unsigned __int20 min = 0;
static ETL_CONSTANT unsigned __int20 max = 0xFFFFF;
static ETL_CONSTANT int bits = 20;
static ETL_CONSTANT bool is_signed = false;
};

template <typename T>
ETL_CONSTANT unsigned __int20 statics_unsigned___int20<T>::min;

template <typename T>
ETL_CONSTANT unsigned __int20 statics_unsigned___int20<T>::max;

template <typename T>
ETL_CONSTANT int statics_unsigned___int20<T>::bits;

template <typename T>
ETL_CONSTANT bool statics_unsigned___int20<T>::is_signed;
#endif
}

//***************************************************************************
Expand Down Expand Up @@ -556,6 +604,21 @@ namespace etl
struct integral_limits<unsigned long long> : public private_integral_limits::statics_unsigned_long_long<>
{
};

#if ETL_USING_20BIT_TYPES
//***************************************************************************
///\ingroup integral_limits
//***************************************************************************
template <>
struct integral_limits<__int20> : public private_integral_limits::statics___int20<>
{
};

template <>
struct integral_limits<unsigned __int20> : public private_integral_limits::statics_unsigned___int20<>
{
};
#endif
}

#include "private/minmax_pop.h"
Expand Down
4 changes: 2 additions & 2 deletions src/etl/intrusive_forward_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ namespace etl

reference operator *() const
{
#include "etl/private/diagnostic_null_dereference_push.h"
#include "private/diagnostic_null_dereference_push.h"
return *static_cast<pointer>(p_value);
#include "etl/private/diagnostic_pop.h"
#include "private/diagnostic_pop.h"
}

pointer operator &() const
Expand Down
4 changes: 2 additions & 2 deletions src/etl/intrusive_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,9 @@ namespace etl

reference operator *() const
{
#include "etl/private/diagnostic_null_dereference_push.h"
#include "private/diagnostic_null_dereference_push.h"
return *static_cast<pointer>(p_value);
#include "etl/private/diagnostic_pop.h"
#include "private/diagnostic_pop.h"
}

pointer operator &() const
Expand Down
2 changes: 1 addition & 1 deletion src/etl/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -2229,7 +2229,7 @@ namespace etl
template <typename... T>
constexpr auto make_list(T... t) -> etl::list<typename etl::common_type_t<T...>, sizeof...(T)>
{
return { { etl::forward<T>(t)... } };
return { etl::forward<T>(t)... };
}
#endif

Expand Down
Loading

0 comments on commit 97d1ba9

Please sign in to comment.