mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Removed redundant 'const' qualifiers in non-type template parameters
This commit is contained in:
parent
4d153b2a18
commit
963e39f716
@ -105,12 +105,12 @@ namespace etl
|
||||
//***************************************************************************
|
||||
// Matcher.
|
||||
//***************************************************************************
|
||||
template <const bool IS_MATCH, const size_t ALIGNMENT, typename T1 = void, typename T2 = void, typename T3 = void, typename T4 = void,
|
||||
typename T5 = void, typename T6 = void, typename T7 = void, typename T8 = void>
|
||||
template <bool IS_MATCH, const size_t ALIGNMENT, typename T1 = void, typename T2 = void, typename T3 = void, typename T4 = void,
|
||||
typename T5 = void, typename T6 = void, typename T7 = void, typename T8 = void>
|
||||
class type_with_alignment_matcher;
|
||||
|
||||
// Matching alignment.
|
||||
template <const size_t ALIGNMENT, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
|
||||
template <size_t ALIGNMENT, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
|
||||
class type_with_alignment_matcher <true, ALIGNMENT, T1, T2, T3, T4, T5, T6, T7, T8>
|
||||
{
|
||||
public:
|
||||
@ -119,7 +119,7 @@ namespace etl
|
||||
};
|
||||
|
||||
// Non-matching alignment.
|
||||
template <const size_t ALIGNMENT, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
|
||||
template <size_t ALIGNMENT, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
|
||||
class type_with_alignment_matcher <false, ALIGNMENT, T1, T2, T3, T4, T5, T6, T7, T8>
|
||||
{
|
||||
public:
|
||||
@ -128,7 +128,7 @@ namespace etl
|
||||
};
|
||||
|
||||
// Non-matching alignment, none left.
|
||||
template <const size_t ALIGNMENT>
|
||||
template <size_t ALIGNMENT>
|
||||
class type_with_alignment_matcher <false, ALIGNMENT, void, void, void, void, void, void, void, void>
|
||||
{
|
||||
public:
|
||||
@ -139,7 +139,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
// Helper.
|
||||
//***************************************************************************
|
||||
template <const size_t ALIGNMENT, typename T1, typename T2 = void, typename T3 = void, typename T4 = void,
|
||||
template <size_t ALIGNMENT, typename T1, typename T2 = void, typename T3 = void, typename T4 = void,
|
||||
typename T5 = void, typename T6 = void, typename T7 = void, typename T8 = void>
|
||||
class type_with_alignment_helper
|
||||
{
|
||||
@ -153,7 +153,7 @@ namespace etl
|
||||
/// Gets a type that has the same as the specified alignment.
|
||||
///\ingroup alignment
|
||||
//***************************************************************************
|
||||
template <const size_t ALIGNMENT>
|
||||
template <size_t ALIGNMENT>
|
||||
class type_with_alignment
|
||||
{
|
||||
public:
|
||||
@ -170,7 +170,7 @@ namespace etl
|
||||
/// LENGTH should be determined in terms of sizeof()
|
||||
///\ingroup alignment
|
||||
//***************************************************************************
|
||||
template <const size_t LENGTH, const size_t ALIGNMENT>
|
||||
template <size_t LENGTH, const size_t ALIGNMENT>
|
||||
struct aligned_storage
|
||||
{
|
||||
struct type
|
||||
@ -261,7 +261,7 @@ namespace etl
|
||||
};
|
||||
|
||||
#if ETL_USING_CPP11
|
||||
template <const size_t LENGTH, const size_t ALIGNMENT>
|
||||
template <size_t LENGTH, const size_t ALIGNMENT>
|
||||
using aligned_storage_t = typename aligned_storage<LENGTH, ALIGNMENT>::type;
|
||||
#endif
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ namespace etl
|
||||
///\ingroup binary
|
||||
//***************************************************************************
|
||||
/// Definition for non-zero NBITS.
|
||||
template <const size_t NBITS>
|
||||
template <size_t NBITS>
|
||||
struct max_value_for_nbits
|
||||
{
|
||||
typedef typename etl::smallest_uint_for_bits<NBITS>::type value_type;
|
||||
@ -100,11 +100,11 @@ namespace etl
|
||||
static ETL_CONSTANT value_type value = 0;
|
||||
};
|
||||
|
||||
template <const size_t NBITS>
|
||||
template <size_t NBITS>
|
||||
ETL_CONSTANT typename max_value_for_nbits<NBITS>::value_type max_value_for_nbits<NBITS>::value;
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
template <const size_t NBITS>
|
||||
template <size_t NBITS>
|
||||
inline constexpr typename etl::max_value_for_nbits<NBITS>::value_type max_value_for_nbits_v = max_value_for_nbits<NBITS>::value;
|
||||
#endif
|
||||
|
||||
@ -387,18 +387,18 @@ namespace etl
|
||||
/// Starts from LSB.
|
||||
///\ingroup binary
|
||||
//***************************************************************************
|
||||
template <const size_t POSITION>
|
||||
template <size_t POSITION>
|
||||
struct bit
|
||||
{
|
||||
typedef typename etl::smallest_uint_for_bits<POSITION + 1>::type value_type;
|
||||
static ETL_CONSTANT value_type value = value_type(1) << POSITION;
|
||||
};
|
||||
|
||||
template <const size_t POSITION>
|
||||
template <size_t POSITION>
|
||||
ETL_CONSTANT typename bit<POSITION>::value_type bit<POSITION>::value;
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
template <const size_t POSITION>
|
||||
template <size_t POSITION>
|
||||
inline constexpr typename bit<POSITION>::value_type bit_v = bit<POSITION>::value;
|
||||
#endif
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// The common base for a bip_buffer_spsc_atomic_base.
|
||||
//***************************************************************************
|
||||
template <const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
|
||||
template <size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
|
||||
class bip_buffer_spsc_atomic_base
|
||||
{
|
||||
public:
|
||||
|
||||
@ -69,7 +69,7 @@ namespace etl
|
||||
/// The hash classes must define <b>argument_type</b>.
|
||||
///\ingroup bloom_filter
|
||||
//***************************************************************************
|
||||
template <const size_t DESIRED_WIDTH,
|
||||
template <size_t DESIRED_WIDTH,
|
||||
typename THash1,
|
||||
typename THash2 = private_bloom_filter::null_hash,
|
||||
typename THash3 = private_bloom_filter::null_hash>
|
||||
|
||||
@ -45,7 +45,7 @@ namespace etl
|
||||
/// \tparam OFFSET The lowest callback id value.
|
||||
/// The callback ids must range between OFFSET and OFFSET + RANGE - 1.
|
||||
//***************************************************************************
|
||||
template <const size_t RANGE, const size_t OFFSET = 0U>
|
||||
template <size_t RANGE, size_t OFFSET = 0U>
|
||||
class callback_service
|
||||
{
|
||||
public:
|
||||
@ -67,7 +67,7 @@ namespace etl
|
||||
/// \tparam ID The id of the callback.
|
||||
/// \param callback Reference to the callback.
|
||||
//*************************************************************************
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
void register_callback(etl::ifunction<size_t>& callback)
|
||||
{
|
||||
ETL_STATIC_ASSERT(ID < (OFFSET + RANGE), "Callback Id out of range");
|
||||
@ -82,7 +82,7 @@ namespace etl
|
||||
/// \param id Id of the callback.
|
||||
/// \param callback Reference to the callback.
|
||||
//*************************************************************************
|
||||
void register_callback(const size_t id, etl::ifunction<size_t>& callback)
|
||||
void register_callback(size_t id, etl::ifunction<size_t>& callback)
|
||||
{
|
||||
if ((id >= OFFSET) && (id < (OFFSET + RANGE)))
|
||||
{
|
||||
@ -104,7 +104,7 @@ namespace etl
|
||||
/// Compile time assert if the id is out of range.
|
||||
/// \tparam ID The id of the callback.
|
||||
//*************************************************************************
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
void callback()
|
||||
{
|
||||
ETL_STATIC_ASSERT(ID < (OFFSET + RANGE), "Callback Id out of range");
|
||||
@ -117,7 +117,7 @@ namespace etl
|
||||
/// Executes the callback function for the index.
|
||||
/// \param id Id of the callback.
|
||||
//*************************************************************************
|
||||
void callback(const size_t id)
|
||||
void callback(size_t id)
|
||||
{
|
||||
if ((id >= OFFSET) && (id < (OFFSET + RANGE)))
|
||||
{
|
||||
|
||||
@ -45,13 +45,13 @@ namespace etl
|
||||
///\ingroup combinations
|
||||
/// Calculates combinations.
|
||||
//***************************************************************************
|
||||
template <const size_t NV, const size_t KV>
|
||||
template <size_t NV, size_t KV>
|
||||
struct combinations
|
||||
{
|
||||
static ETL_CONSTANT size_t value = etl::permutations<NV, KV>::value / etl::factorial<KV>::value;
|
||||
};
|
||||
|
||||
template <const size_t NV, const size_t KV>
|
||||
template <size_t NV, size_t KV>
|
||||
ETL_CONSTANT size_t combinations<NV, KV>::value;
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
|
||||
@ -47,8 +47,8 @@ namespace etl
|
||||
/// The delegate ids must range between Offset and Offset + Range - 1.
|
||||
//***************************************************************************
|
||||
#if ETL_USING_CPP11 && !defined(ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION)
|
||||
template <const size_t Range,
|
||||
const size_t Offset = 0U,
|
||||
template <size_t Range,
|
||||
size_t Offset = 0U,
|
||||
const etl::delegate<void(size_t)>* Delegates = nullptr>
|
||||
class delegate_service
|
||||
{
|
||||
@ -61,7 +61,7 @@ namespace etl
|
||||
/// Compile time assert if the id is out of range.
|
||||
/// \tparam Id The id of the delegate.
|
||||
//*************************************************************************
|
||||
template <const size_t Id>
|
||||
template <size_t Id>
|
||||
void call() const
|
||||
{
|
||||
ETL_STATIC_ASSERT(Id < (Offset + Range), "Callback Id out of range");
|
||||
@ -74,7 +74,7 @@ namespace etl
|
||||
/// Executes the delegate function for the index.
|
||||
/// \param id Id of the delegate.
|
||||
//*************************************************************************
|
||||
void call(const size_t id) const
|
||||
void call(size_t id) const
|
||||
{
|
||||
if ((id >= Offset) && (id < (Offset + Range)))
|
||||
{
|
||||
@ -96,8 +96,8 @@ namespace etl
|
||||
/// \tparam Offset The lowest delegate id value.
|
||||
/// The delegate ids must range between Offset and Offset + Range - 1.
|
||||
//***************************************************************************
|
||||
template <const size_t Range,
|
||||
const size_t Offset>
|
||||
template <size_t Range,
|
||||
size_t Offset>
|
||||
#if ETL_USING_CPP11 && !defined(ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION)
|
||||
class delegate_service<Range, Offset, nullptr>
|
||||
#else
|
||||
@ -125,7 +125,7 @@ namespace etl
|
||||
/// \tparam Id The id of the delegate.
|
||||
/// \param delegate Reference to the delegate.
|
||||
//*************************************************************************
|
||||
template <const size_t Id>
|
||||
template <size_t Id>
|
||||
void register_delegate(delegate_type callback)
|
||||
{
|
||||
ETL_STATIC_ASSERT(Id < (Offset + Range), "Callback Id out of range");
|
||||
@ -140,7 +140,7 @@ namespace etl
|
||||
/// \param id Id of the delegate.
|
||||
/// \param delegate Reference to the delegate.
|
||||
//*************************************************************************
|
||||
void register_delegate(const size_t id, delegate_type callback)
|
||||
void register_delegate(size_t id, delegate_type callback)
|
||||
{
|
||||
if ((id >= Offset) && (id < (Offset + Range)))
|
||||
{
|
||||
@ -162,7 +162,7 @@ namespace etl
|
||||
/// Compile time assert if the id is out of range.
|
||||
/// \tparam Id The id of the delegate.
|
||||
//*************************************************************************
|
||||
template <const size_t Id>
|
||||
template <size_t Id>
|
||||
void call() const
|
||||
{
|
||||
ETL_STATIC_ASSERT(Id < (Offset + Range), "Callback Id out of range");
|
||||
|
||||
@ -154,7 +154,7 @@ namespace etl
|
||||
cog.outl("private:")
|
||||
cog.outl("")
|
||||
cog.outl(" // Declaration.")
|
||||
cog.outl(" template <const bool Boolean, typename TrueType, typename FalseType>")
|
||||
cog.outl(" template <bool Boolean, typename TrueType, typename FalseType>")
|
||||
cog.outl(" struct choose_type;")
|
||||
cog.outl("")
|
||||
cog.outl(" // Specialisation for 'true'.")
|
||||
@ -226,7 +226,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
// Determine the type to hold the number of bits based on the index.
|
||||
//*************************************************************************
|
||||
template <const int index>
|
||||
template <int index>
|
||||
struct best_fit_uint_type;
|
||||
|
||||
//*************************************************************************
|
||||
@ -270,7 +270,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
// Determine the type to hold the number of bits based on the index.
|
||||
//*************************************************************************
|
||||
template <const int index>
|
||||
template <int index>
|
||||
struct best_fit_int_type;
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -116,7 +116,7 @@ namespace etl
|
||||
cog.outl("{")
|
||||
cog.outl("public:")
|
||||
cog.outl("")
|
||||
cog.outl(" template <const size_t ID>")
|
||||
cog.outl(" template <size_t ID>")
|
||||
cog.outl(" struct select")
|
||||
cog.outl(" {")
|
||||
cog.outl(" typedef typename etl::conditional<ID == 0, T0,")
|
||||
@ -151,7 +151,7 @@ namespace etl
|
||||
cog.outl("T%s>" % (s - 1))
|
||||
cog.outl("{")
|
||||
cog.outl("public:")
|
||||
cog.outl(" template <const size_t ID>")
|
||||
cog.outl(" template <size_t ID>")
|
||||
cog.outl(" struct select")
|
||||
cog.outl(" {")
|
||||
cog.outl(" typedef typename etl::conditional<ID == 0, T0,")
|
||||
|
||||
@ -76,7 +76,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/*[[[cog
|
||||
import cog
|
||||
cog.outl("template <const size_t MAX_SIZE_,")
|
||||
cog.outl("template <size_t MAX_SIZE_,")
|
||||
cog.outl(" typename T1,")
|
||||
for n in range(2, int(NTypes)):
|
||||
cog.outl(" typename T%s = void," % n)
|
||||
|
||||
@ -51,7 +51,7 @@ namespace etl
|
||||
/// A templated abstract pool implementation that uses a fixed size pool.
|
||||
///\ingroup pool
|
||||
//*************************************************************************
|
||||
template <const size_t VTypeSize, const size_t VAlignment, const size_t VSize>
|
||||
template <size_t VTypeSize, size_t VAlignment, size_t VSize>
|
||||
class generic_pool : public etl::ipool
|
||||
{
|
||||
public:
|
||||
@ -194,13 +194,13 @@ namespace etl
|
||||
generic_pool& operator =(const generic_pool&) ETL_DELETE;
|
||||
};
|
||||
|
||||
template <const size_t VTypeSize, const size_t VAlignment, const size_t VSize>
|
||||
template <size_t VTypeSize, size_t VAlignment, size_t VSize>
|
||||
ETL_CONSTANT size_t generic_pool<VTypeSize, VAlignment, VSize>::SIZE;
|
||||
|
||||
template <const size_t VTypeSize, const size_t VAlignment, const size_t VSize>
|
||||
template <size_t VTypeSize, size_t VAlignment, size_t VSize>
|
||||
ETL_CONSTANT size_t generic_pool<VTypeSize, VAlignment, VSize>::ALIGNMENT;
|
||||
|
||||
template <const size_t VTypeSize, const size_t VAlignment, const size_t VSize>
|
||||
template <size_t VTypeSize, size_t VAlignment, size_t VSize>
|
||||
ETL_CONSTANT size_t generic_pool<VTypeSize, VAlignment, VSize>::TYPE_SIZE;
|
||||
|
||||
//*************************************************************************
|
||||
@ -208,7 +208,7 @@ namespace etl
|
||||
/// The storage for the pool is supplied externally.
|
||||
///\ingroup pool
|
||||
//*************************************************************************
|
||||
template <const size_t VTypeSize, const size_t VAlignment>
|
||||
template <size_t VTypeSize, size_t VAlignment>
|
||||
class generic_pool_ext : public etl::ipool
|
||||
{
|
||||
private:
|
||||
@ -348,10 +348,10 @@ namespace etl
|
||||
generic_pool_ext& operator=(const generic_pool_ext&) ETL_DELETE;
|
||||
};
|
||||
|
||||
template <const size_t VTypeSize, const size_t VAlignment>
|
||||
template <size_t VTypeSize, size_t VAlignment>
|
||||
ETL_CONSTANT size_t generic_pool_ext<VTypeSize, VAlignment>::ALIGNMENT;
|
||||
|
||||
template <const size_t VTypeSize, const size_t VAlignment>
|
||||
template <size_t VTypeSize, size_t VAlignment>
|
||||
ETL_CONSTANT size_t generic_pool_ext<VTypeSize, VAlignment>::TYPE_SIZE;
|
||||
}
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// A forward link.
|
||||
//***************************************************************************
|
||||
template <const size_t ID_>
|
||||
template <size_t ID_>
|
||||
struct forward_link
|
||||
{
|
||||
enum
|
||||
@ -240,7 +240,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// A bidirectional link.
|
||||
//***************************************************************************
|
||||
template <const size_t ID_>
|
||||
template <size_t ID_>
|
||||
struct bidirectional_link
|
||||
{
|
||||
enum
|
||||
@ -497,7 +497,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// A binary tree link.
|
||||
//***************************************************************************
|
||||
template <const size_t ID_>
|
||||
template <size_t ID_>
|
||||
struct tree_link
|
||||
{
|
||||
enum
|
||||
|
||||
@ -94,7 +94,7 @@ namespace etl
|
||||
///\ingroup log
|
||||
/// Calculates base 2 logs.
|
||||
//***************************************************************************
|
||||
template <const size_t NV>
|
||||
template <size_t NV>
|
||||
struct log2
|
||||
{
|
||||
enum value_type
|
||||
@ -112,7 +112,7 @@ namespace etl
|
||||
///\ingroup log
|
||||
/// Calculates base 10 logs.
|
||||
//***************************************************************************
|
||||
template <const size_t NV>
|
||||
template <size_t NV>
|
||||
struct log10
|
||||
{
|
||||
enum value_type
|
||||
|
||||
@ -46,7 +46,7 @@ namespace etl
|
||||
ETL_USER_TYPE(MEMORY_MODEL_HUGE, 3)
|
||||
ETL_END_USER_TYPE(memory_model)
|
||||
|
||||
template <const size_t MEMORY_MODEL>
|
||||
template <size_t MEMORY_MODEL>
|
||||
struct size_type_lookup;
|
||||
|
||||
template <>
|
||||
|
||||
@ -56,7 +56,7 @@ namespace etl
|
||||
///\tparam HASH_LENGTH The number of elements in the hash.
|
||||
/// \ingroup pearson
|
||||
//***************************************************************************
|
||||
template <const size_t HASH_LENGTH>
|
||||
template <size_t HASH_LENGTH>
|
||||
class pearson
|
||||
{
|
||||
public:
|
||||
|
||||
@ -43,26 +43,26 @@ namespace etl
|
||||
///\ingroup permutations
|
||||
/// Calculates permutations.
|
||||
//***************************************************************************
|
||||
template <const size_t NV, const size_t KV>
|
||||
template <size_t NV, size_t KV>
|
||||
struct permutations
|
||||
{
|
||||
static ETL_CONSTANT size_t value = NV * permutations<NV - 1, KV - 1>::value;
|
||||
};
|
||||
|
||||
template <const size_t NV, const size_t KV>
|
||||
template <size_t NV, size_t KV>
|
||||
ETL_CONSTANT size_t permutations<NV, KV>::value;
|
||||
|
||||
//***************************************************************************
|
||||
/// Calculates permutations.
|
||||
/// Specialisation for KV == 0.
|
||||
//***************************************************************************
|
||||
template <const size_t NV>
|
||||
template <size_t NV>
|
||||
struct permutations<NV, 0>
|
||||
{
|
||||
static ETL_CONSTANT size_t value = 1UL;
|
||||
};
|
||||
|
||||
template <const size_t NV>
|
||||
template <size_t NV>
|
||||
ETL_CONSTANT size_t permutations<NV, 0>::value;
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
|
||||
@ -544,7 +544,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
/// Obtains a poly_span that is a view from OFFSET over the next COUNT elements of this poly_span.
|
||||
//*************************************************************************
|
||||
template <const size_t OFFSET, size_t COUNT = etl::dynamic_extent>
|
||||
template <size_t OFFSET, size_t COUNT = etl::dynamic_extent>
|
||||
ETL_NODISCARD ETL_CONSTEXPR etl::poly_span<element_type, COUNT != etl::dynamic_extent ? COUNT : Extent - OFFSET> subspan() const ETL_NOEXCEPT
|
||||
{
|
||||
return (COUNT == etl::dynamic_extent) ? etl::poly_span<element_type, COUNT != etl::dynamic_extent ? COUNT : Extent - OFFSET>(pbegin, OFFSET, Extent, element_size)
|
||||
@ -554,7 +554,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
/// Obtains a poly_span that is a view from OFFSET over the next COUNT elements of this poly_span.
|
||||
//*************************************************************************
|
||||
template <const size_t OFFSET, size_t COUNT>
|
||||
template <size_t OFFSET, size_t COUNT>
|
||||
etl::poly_span<element_type, COUNT != etl::dynamic_extent ? COUNT : Extent - OFFSET> subspan() const
|
||||
{
|
||||
if (COUNT == etl::dynamic_extent)
|
||||
@ -919,7 +919,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
/// Obtains a poly_span that is a view from OFFSET over the next COUNT elements of this poly_span.
|
||||
//*************************************************************************
|
||||
template <const size_t OFFSET, size_t COUNT = etl::dynamic_extent>
|
||||
template <size_t OFFSET, size_t COUNT = etl::dynamic_extent>
|
||||
ETL_NODISCARD ETL_CONSTEXPR etl::poly_span<element_type, COUNT != etl::dynamic_extent ? COUNT : etl::dynamic_extent> subspan() const ETL_NOEXCEPT
|
||||
{
|
||||
return (COUNT == etl::dynamic_extent) ? etl::poly_span<element_type, COUNT != etl::dynamic_extent ? COUNT : etl::dynamic_extent>(pbegin, OFFSET, span_extent, element_size)
|
||||
@ -929,7 +929,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
/// Obtains a poly_span that is a view from OFFSET over the next COUNT elements of this poly_span.
|
||||
//*************************************************************************
|
||||
template <const size_t OFFSET, size_t COUNT>
|
||||
template <size_t OFFSET, size_t COUNT>
|
||||
etl::poly_span<element_type, COUNT != etl::dynamic_extent ? COUNT : etl::dynamic_extent> subspan() const
|
||||
{
|
||||
if (COUNT == etl::dynamic_extent)
|
||||
|
||||
@ -57,13 +57,13 @@ namespace etl
|
||||
/// Calculates powers.
|
||||
///\note Only supports positive N.
|
||||
//***************************************************************************
|
||||
template <const size_t NV, const size_t POWER>
|
||||
template <size_t NV, size_t POWER>
|
||||
struct power
|
||||
{
|
||||
static ETL_CONSTANT private_power::type value = NV * power<NV, POWER - 1>::value;
|
||||
};
|
||||
|
||||
template <const size_t NV, const size_t POWER>
|
||||
template <size_t NV, size_t POWER>
|
||||
ETL_CONSTANT private_power::type power<NV, POWER>::value;
|
||||
|
||||
//***************************************************************************
|
||||
@ -71,13 +71,13 @@ namespace etl
|
||||
///\note Only supports positive N.
|
||||
/// Specialisation for POWER == 0.
|
||||
//***************************************************************************
|
||||
template <const size_t NV>
|
||||
template <size_t NV>
|
||||
struct power<NV, 0>
|
||||
{
|
||||
static ETL_CONSTANT private_power::type value = 1;
|
||||
};
|
||||
|
||||
template <const size_t NV>
|
||||
template <size_t NV>
|
||||
ETL_CONSTANT private_power::type power<NV, 0>::value;
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
@ -89,7 +89,7 @@ namespace etl
|
||||
///\ingroup power
|
||||
/// Calculates the rounded up power of 2.
|
||||
//***************************************************************************
|
||||
template <const size_t NV>
|
||||
template <size_t NV>
|
||||
struct power_of_2_round_up
|
||||
{
|
||||
enum value_type
|
||||
@ -121,7 +121,7 @@ namespace etl
|
||||
///\ingroup power
|
||||
/// Calculates the rounded down power of 2.
|
||||
//***************************************************************************
|
||||
template <const size_t NV>
|
||||
template <size_t NV>
|
||||
struct power_of_2_round_down
|
||||
{
|
||||
enum value_type
|
||||
@ -181,7 +181,7 @@ namespace etl
|
||||
///\ingroup power
|
||||
/// Checks if N is a power of 2.
|
||||
//***************************************************************************
|
||||
template <const size_t NV>
|
||||
template <size_t NV>
|
||||
struct is_power_of_2
|
||||
{
|
||||
static ETL_CONSTANT bool value = (NV & (NV - 1)) == 0;
|
||||
@ -209,7 +209,7 @@ namespace etl
|
||||
static ETL_CONSTANT bool value = false;
|
||||
};
|
||||
|
||||
template <const size_t NV>
|
||||
template <size_t NV>
|
||||
ETL_CONSTANT bool is_power_of_2<NV>::value;
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
|
||||
@ -1086,7 +1086,7 @@ namespace etl
|
||||
///\tparam MaxN The number of bits.
|
||||
///\ingroup bitset
|
||||
//*************************************************************************
|
||||
template <const size_t MaxN>
|
||||
template <size_t MaxN>
|
||||
class bitset : public etl::ibitset
|
||||
{
|
||||
|
||||
@ -1444,17 +1444,17 @@ namespace etl
|
||||
element_type data[Array_Size > 0U ? Array_Size : 1U];
|
||||
};
|
||||
|
||||
template <const size_t MaxN>
|
||||
template <size_t MaxN>
|
||||
ETL_CONSTANT size_t bitset<MaxN>::ALLOCATED_BITS;
|
||||
|
||||
template <const size_t MaxN>
|
||||
template <size_t MaxN>
|
||||
ETL_CONSTANT size_t bitset<MaxN>::Allocated_Bits;
|
||||
|
||||
//***************************************************************************
|
||||
/// operator &
|
||||
///\ingroup bitset
|
||||
//***************************************************************************
|
||||
template <const size_t MaxN>
|
||||
template <size_t MaxN>
|
||||
bitset<MaxN> operator & (const bitset<MaxN>& lhs, const bitset<MaxN>& rhs)
|
||||
{
|
||||
bitset<MaxN> temp(lhs);
|
||||
@ -1466,7 +1466,7 @@ namespace etl
|
||||
/// operator |
|
||||
///\ingroup bitset
|
||||
//***************************************************************************
|
||||
template<const size_t MaxN>
|
||||
template<size_t MaxN>
|
||||
bitset<MaxN> operator | (const bitset<MaxN>& lhs, const bitset<MaxN>& rhs)
|
||||
{
|
||||
bitset<MaxN> temp(lhs);
|
||||
@ -1478,7 +1478,7 @@ namespace etl
|
||||
/// operator ^
|
||||
///\ingroup bitset
|
||||
//***************************************************************************
|
||||
template<const size_t MaxN>
|
||||
template<size_t MaxN>
|
||||
bitset<MaxN> operator ^ (const bitset<MaxN>& lhs, const bitset<MaxN>& rhs)
|
||||
{
|
||||
bitset<MaxN> temp(lhs);
|
||||
@ -1490,7 +1490,7 @@ namespace etl
|
||||
/// operator !=
|
||||
///\ingroup bitset
|
||||
//***************************************************************************
|
||||
template<const size_t MaxN>
|
||||
template<size_t MaxN>
|
||||
bool operator != (const bitset<MaxN>& lhs, const bitset<MaxN>& rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
@ -1500,7 +1500,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
/// swap
|
||||
//*************************************************************************
|
||||
template <const size_t MaxN>
|
||||
template <size_t MaxN>
|
||||
void swap(etl::bitset<MaxN>& lhs, etl::bitset<MaxN>& rhs)
|
||||
{
|
||||
lhs.swap(rhs);
|
||||
|
||||
@ -65,7 +65,7 @@ namespace etl
|
||||
/// Placeholder for unused template parameters.
|
||||
/// This class is never instantiated.
|
||||
//*************************************************************************
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct no_type
|
||||
{
|
||||
};
|
||||
|
||||
@ -103,7 +103,7 @@ namespace etl
|
||||
/// The base class for all queues.
|
||||
///\ingroup queue
|
||||
//***************************************************************************
|
||||
template <const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
|
||||
template <size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
|
||||
class queue_base
|
||||
{
|
||||
public:
|
||||
|
||||
@ -48,7 +48,7 @@ SOFTWARE.
|
||||
|
||||
namespace etl
|
||||
{
|
||||
template <const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
|
||||
template <size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
|
||||
class queue_mpmc_mutex_base
|
||||
{
|
||||
public:
|
||||
|
||||
@ -47,7 +47,7 @@ SOFTWARE.
|
||||
|
||||
namespace etl
|
||||
{
|
||||
template <const size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
|
||||
template <size_t MEMORY_MODEL = etl::memory_model::MEMORY_MODEL_LARGE>
|
||||
class queue_spsc_atomic_base
|
||||
{
|
||||
public:
|
||||
|
||||
@ -41,17 +41,17 @@ SOFTWARE.
|
||||
|
||||
namespace etl
|
||||
{
|
||||
template <const size_t NUM, const size_t DEN = 1UL>
|
||||
template <size_t NUM, size_t DEN = 1UL>
|
||||
struct ratio
|
||||
{
|
||||
static ETL_CONSTANT intmax_t num = NUM;
|
||||
static ETL_CONSTANT intmax_t den = DEN;
|
||||
};
|
||||
|
||||
template <const size_t NUM, const size_t DEN>
|
||||
template <size_t NUM, size_t DEN>
|
||||
ETL_CONSTANT intmax_t ratio<NUM, DEN>::num;
|
||||
|
||||
template <const size_t NUM, const size_t DEN>
|
||||
template <size_t NUM, size_t DEN>
|
||||
ETL_CONSTANT intmax_t ratio<NUM, DEN>::den;
|
||||
|
||||
#if INT_MAX > INT32_MAX
|
||||
|
||||
@ -137,7 +137,7 @@ namespace etl
|
||||
private:
|
||||
|
||||
// Declaration.
|
||||
template <const bool Boolean, typename TrueType, typename FalseType>
|
||||
template <bool Boolean, typename TrueType, typename FalseType>
|
||||
struct choose_type;
|
||||
|
||||
// Specialisation for 'true'.
|
||||
@ -196,7 +196,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
// Determine the type to hold the number of bits based on the index.
|
||||
//*************************************************************************
|
||||
template <const int index>
|
||||
template <int index>
|
||||
struct best_fit_uint_type;
|
||||
|
||||
//*************************************************************************
|
||||
@ -240,7 +240,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
// Determine the type to hold the number of bits based on the index.
|
||||
//*************************************************************************
|
||||
template <const int index>
|
||||
template <int index>
|
||||
struct best_fit_int_type;
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -403,7 +403,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
/// Obtains a span that is a view from OFFSET over the next COUNT elements of this span.
|
||||
//*************************************************************************
|
||||
template <const size_t OFFSET, size_t COUNT = etl::dynamic_extent>
|
||||
template <size_t OFFSET, size_t COUNT = etl::dynamic_extent>
|
||||
ETL_NODISCARD ETL_CONSTEXPR
|
||||
etl::span<element_type, COUNT != etl::dynamic_extent ? COUNT : Extent - OFFSET> subspan() const ETL_NOEXCEPT
|
||||
{
|
||||
@ -414,7 +414,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
/// Obtains a span that is a view from OFFSET over the next COUNT elements of this span.
|
||||
//*************************************************************************
|
||||
template <const size_t OFFSET, size_t COUNT>
|
||||
template <size_t OFFSET, size_t COUNT>
|
||||
etl::span<element_type, COUNT != etl::dynamic_extent ? COUNT : Extent - OFFSET> subspan() const
|
||||
{
|
||||
if (COUNT == etl::dynamic_extent)
|
||||
@ -809,7 +809,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
/// Obtains a span that is a view from OFFSET over the next COUNT elements of this span.
|
||||
//*************************************************************************
|
||||
template <const size_t OFFSET, size_t COUNT = etl::dynamic_extent>
|
||||
template <size_t OFFSET, size_t COUNT = etl::dynamic_extent>
|
||||
ETL_NODISCARD ETL_CONSTEXPR
|
||||
etl::span<element_type, COUNT != etl::dynamic_extent ? COUNT : etl::dynamic_extent> subspan() const ETL_NOEXCEPT
|
||||
{
|
||||
@ -820,7 +820,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
/// Obtains a span that is a view from OFFSET over the next COUNT elements of this span.
|
||||
//*************************************************************************
|
||||
template <const size_t OFFSET, size_t COUNT>
|
||||
template <size_t OFFSET, size_t COUNT>
|
||||
etl::span<element_type, COUNT != etl::dynamic_extent ? COUNT : etl::dynamic_extent> subspan() const
|
||||
{
|
||||
if (COUNT == etl::dynamic_extent)
|
||||
|
||||
@ -63,7 +63,7 @@ namespace etl
|
||||
///\tparam MAX_SIZE_ The maximum number of elements that can be stored.
|
||||
///\ingroup string
|
||||
//***************************************************************************
|
||||
template <const size_t MAX_SIZE_>
|
||||
template <size_t MAX_SIZE_>
|
||||
class string : public istring
|
||||
{
|
||||
public:
|
||||
@ -463,7 +463,7 @@ namespace etl
|
||||
}
|
||||
};
|
||||
|
||||
template <const size_t SIZE>
|
||||
template <size_t SIZE>
|
||||
struct hash<etl::string<SIZE> >
|
||||
{
|
||||
size_t operator()(const etl::string<SIZE>& text) const
|
||||
@ -496,7 +496,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// Make string with max capacity from string literal or array
|
||||
//***************************************************************************
|
||||
template<const size_t MAX_SIZE, const size_t SIZE>
|
||||
template<size_t MAX_SIZE, size_t SIZE>
|
||||
etl::string<MAX_SIZE> make_string_with_capacity(const char(&text)[SIZE])
|
||||
{
|
||||
return etl::string<MAX_SIZE>(text, etl::strlen(text, SIZE));
|
||||
|
||||
@ -114,7 +114,7 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -162,7 +162,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -208,7 +208,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -252,7 +252,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -294,7 +294,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -334,7 +334,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -372,7 +372,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -408,7 +408,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2, T3, T4, T5, T6, T7, T8>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -442,7 +442,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2, T3, T4, T5, T6, T7>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -473,7 +473,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2, T3, T4, T5, T6>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -502,7 +502,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2, T3, T4, T5>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -529,7 +529,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2, T3, T4>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -554,7 +554,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2, T3>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -577,7 +577,7 @@ namespace etl
|
||||
struct type_select<T0, T1, T2>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -598,7 +598,7 @@ namespace etl
|
||||
struct type_select<T0, T1>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
@ -617,7 +617,7 @@ namespace etl
|
||||
struct type_select<T0>
|
||||
{
|
||||
public:
|
||||
template <const size_t ID>
|
||||
template <size_t ID>
|
||||
struct select
|
||||
{
|
||||
typedef typename etl::conditional<ID == 0, T0,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace etl
|
||||
///\tparam MAX_SIZE_ The maximum number of elements that can be stored.
|
||||
///\ingroup u16string
|
||||
//***************************************************************************
|
||||
template <const size_t MAX_SIZE_>
|
||||
template <size_t MAX_SIZE_>
|
||||
class u16string : public iu16string
|
||||
{
|
||||
public:
|
||||
@ -443,7 +443,7 @@ namespace etl
|
||||
}
|
||||
};
|
||||
|
||||
template <const size_t SIZE>
|
||||
template <size_t SIZE>
|
||||
struct hash<etl::u16string<SIZE> >
|
||||
{
|
||||
size_t operator()(const etl::u16string<SIZE>& text) const
|
||||
@ -476,7 +476,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// Make string with max capacity from string literal or array
|
||||
//***************************************************************************
|
||||
template<const size_t MAX_SIZE, const size_t SIZE>
|
||||
template<size_t MAX_SIZE, size_t SIZE>
|
||||
etl::u16string<MAX_SIZE> make_string_with_capacity(const char16_t(&text)[SIZE])
|
||||
{
|
||||
return etl::u16string<MAX_SIZE>(text, etl::strlen(text, SIZE));
|
||||
|
||||
@ -61,7 +61,7 @@ namespace etl
|
||||
///\tparam MAX_SIZE_ The maximum number of elements that can be stored.
|
||||
///\ingroup u32string
|
||||
//***************************************************************************
|
||||
template <const size_t MAX_SIZE_>
|
||||
template <size_t MAX_SIZE_>
|
||||
class u32string : public iu32string
|
||||
{
|
||||
public:
|
||||
@ -443,7 +443,7 @@ namespace etl
|
||||
}
|
||||
};
|
||||
|
||||
template <const size_t SIZE>
|
||||
template <size_t SIZE>
|
||||
struct hash<etl::u32string<SIZE> >
|
||||
{
|
||||
size_t operator()(const etl::u32string<SIZE>& text) const
|
||||
@ -476,7 +476,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// Make string with max capacity from string literal or array
|
||||
//***************************************************************************
|
||||
template<const size_t MAX_SIZE, const size_t SIZE>
|
||||
template<size_t MAX_SIZE, size_t SIZE>
|
||||
etl::u32string<MAX_SIZE> make_string_with_capacity(const char32_t(&text)[SIZE])
|
||||
{
|
||||
return etl::u32string<MAX_SIZE>(text, etl::strlen(text, SIZE));
|
||||
|
||||
@ -62,7 +62,7 @@ SOFTWARE.
|
||||
namespace etl
|
||||
{
|
||||
//***************************************************************************
|
||||
template <const size_t MAX_SIZE_,
|
||||
template <size_t MAX_SIZE_,
|
||||
typename T1,
|
||||
typename T2 = void,
|
||||
typename T3 = void,
|
||||
|
||||
@ -61,7 +61,7 @@ namespace etl
|
||||
///\tparam MAX_SIZE_ The maximum number of elements that can be stored.
|
||||
///\ingroup wstring
|
||||
//***************************************************************************
|
||||
template <const size_t MAX_SIZE_>
|
||||
template <size_t MAX_SIZE_>
|
||||
class wstring : public iwstring
|
||||
{
|
||||
public:
|
||||
@ -443,7 +443,7 @@ namespace etl
|
||||
}
|
||||
};
|
||||
|
||||
template <const size_t SIZE>
|
||||
template <size_t SIZE>
|
||||
struct hash<etl::wstring<SIZE> >
|
||||
{
|
||||
size_t operator()(const etl::wstring<SIZE>& text) const
|
||||
@ -476,7 +476,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// Make string with max capacity from string literal or array
|
||||
//***************************************************************************
|
||||
template<const size_t MAX_SIZE, const size_t SIZE>
|
||||
template<size_t MAX_SIZE, size_t SIZE>
|
||||
etl::wstring<MAX_SIZE> make_string_with_capacity(const wchar_t(&text)[SIZE])
|
||||
{
|
||||
return etl::wstring<MAX_SIZE>(text, etl::strlen(text, SIZE));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user