30#ifndef ETL_BITSET_NEW_INCLUDED
31#define ETL_BITSET_NEW_INCLUDED
33#include "../platform.h"
34#include "../algorithm.h"
35#include "../iterator.h"
36#include "../integral_limits.h"
37#include "../algorithm.h"
38#include "../nullptr.h"
40#include "../exception.h"
41#include "../integral_limits.h"
43#include "../char_traits.h"
44#include "../static_assert.h"
45#include "../error_handler.h"
55#if defined(ETL_COMPILER_KEIL)
56#pragma diag_suppress 1300
61 #define ETL_STRL(x) L##x
62 #define ETL_STRu(x) u##x
63 #define ETL_STRU(x) U##x
79 template <
typename T =
void>
134 template <
typename TElement>
139 typedef typename etl::make_unsigned<TElement>::type element_type;
146 static ETL_CONSTANT element_type All_Clear_Element = element_type(0);
170 element_type
mask = element_type(0);
175 mask = element_type(1) << position;
180 mask = element_type(1) << (position & (Bits_Per_Element - 1));
183 return (pbuffer[index] &
mask) != 0;
193 element_type
bit = 0;
202 bit = element_type(1) << position;
207 bit = element_type(1) << (position & (Bits_Per_Element - 1));
212 pbuffer[index] |=
bit;
216 pbuffer[index] &=
~bit;
225 if (text == ETL_NULLPTR)
255 if (text == ETL_NULLPTR)
285 if (text == ETL_NULLPTR)
315 if (text == ETL_NULLPTR)
375 template <
typename T>
390 v |=
T(
typename etl::make_unsigned<T>::type(pbuffer[
i]) <<
shift);
404 element_type
bit = element_type(0);
413 bit = element_type(1) << position;
418 bit = element_type(1) << (position & (Bits_Per_Element - 1));
421 pbuffer[index] &=
~bit;
431 pbuffer[
i] = ~pbuffer[
i];
441 element_type
bit = element_type(0);
450 bit = element_type(1) << position;
455 bit = element_type(1) << (position & (Bits_Per_Element - 1));
458 pbuffer[index] ^=
bit;
472 for (
size_t i = 0UL; i < (number_of_elements - 1U); ++i)
474 if (pbuffer[i] != All_Set_Element)
481 if (pbuffer[number_of_elements - 1U] != (All_Set_Element & top_mask))
525 size_t bit = position & (Bits_Per_Element - 1);
532 element_type
value = pbuffer[index];
535 if ((state && (
value != All_Clear_Element)) ||
536 (!state && (
value != All_Set_Element)))
555 position += (Bits_Per_Element -
bit);
571 template <
typename TString>
575 typename TString::value_type
zero,
576 typename TString::value_type
one)
const
601 pbuffer[0] <<=
shift;
603 else if ((
shift % Bits_Per_Element) == 0U)
670 pbuffer[0] >>=
shift;
672 else if ((
shift % Bits_Per_Element) == 0U)
774 pbuffer[0] = element_type(
value);
783 pbuffer[
i++] =
value & All_Set_Element;
790 pbuffer[
i++] = All_Clear_Element;
813 template <
typename TElement>
814 ETL_CONSTANT
size_t bitset_impl<TElement>::Bits_Per_Element;
816 template <
typename TElement>
817 ETL_CONSTANT
typename bitset_impl<TElement>::element_type bitset_impl<TElement>::All_Set_Element;
819 template <
typename TElement>
820 ETL_CONSTANT
typename bitset_impl<TElement>::element_type bitset_impl<TElement>::All_Clear_Element;
823 template <
size_t Active_Bits = 0U,
824 typename TElement = char,
849 template <
size_t Active_Bits,
typename TElement>
855 typedef typename etl::make_unsigned<TElement>::type element_type;
861 static ETL_CONSTANT
size_t Number_Of_Elements = 1U;
862 static ETL_CONSTANT
size_t Allocated_Bits = Bits_Per_Element;
864 static ETL_CONSTANT element_type All_Clear_Element = element_type(0);
865 static ETL_CONSTANT
size_t Top_Mask_Shift = 0U;
866 static ETL_CONSTANT element_type Top_Mask = All_Set_Element;
884 : p_bitset(
other.p_bitset)
885 , position(
other.position)
894 return p_bitset->test(position);
902 p_bitset->set(position,
b);
909 ETL_CONSTEXPR14 bit_reference&
operator = (
const bit_reference&
r) ETL_NOEXCEPT
911 p_bitset->set(position,
bool(
r));
918 ETL_CONSTEXPR14 bit_reference&
flip() ETL_NOEXCEPT
920 p_bitset->flip(position);
929 return !p_bitset->test(position);
937 ETL_CONSTEXPR14 bit_reference() ETL_NOEXCEPT
938 : p_bitset(ETL_NULLPTR)
952 bitset<Active_Bits, TElement, true>* p_bitset;
960 : buffer(All_Clear_Element)
968 : buffer(
other.buffer)
976 : buffer(element_type(
value))
983 ETL_CONSTEXPR14
bitset(
const char* text) ETL_NOEXCEPT
984 : buffer(All_Clear_Element)
992 ETL_CONSTEXPR14
bitset(
const wchar_t* text) ETL_NOEXCEPT
993 : buffer(All_Clear_Element)
1001 ETL_CONSTEXPR14
bitset(
const char16_t* text) ETL_NOEXCEPT
1002 : buffer(All_Clear_Element)
1010 ETL_CONSTEXPR14
bitset(
const char32_t* text) ETL_NOEXCEPT
1011 : buffer(All_Clear_Element)
1021 buffer =
other.buffer;
1031 buffer = All_Set_Element;
1051 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
1053 const element_type
mask = element_type(element_type(1) << position);
1111 if (text == ETL_NULLPTR)
1126 if (text[
i] == ETL_STR(
'1'))
1147 if (text == ETL_NULLPTR)
1162 if (text[
i] == ETL_STRL(
'1'))
1183 if (text == ETL_NULLPTR)
1198 if (text[
i] == ETL_STRu(
'1'))
1219 if (text == ETL_NULLPTR)
1234 if (text[
i] == ETL_STRU(
'1'))
1253 template <
typename T>
1259 ETL_STATIC_ASSERT((
sizeof(
T) *
CHAR_BIT) >= (Number_Of_Elements * Bits_Per_Element),
"Integral type too small");
1263 const bool OK = (
sizeof(
T) *
CHAR_BIT) >= Bits_Per_Element;
1267 v =
T(
typename etl::make_unsigned<T>::type(buffer));
1294 buffer = All_Clear_Element;
1304 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
1306 const element_type
mask = element_type(element_type(1) << position);
1316 ETL_CONSTEXPR14
bool test(
size_t position)
const
1318 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow),
false);
1320 const element_type
mask = element_type(element_type(1) << position);
1321 return (buffer &
mask) != 0U;
1345 ETL_CONSTEXPR14
bool all()
const ETL_NOEXCEPT
1347 return buffer == All_Set_Element;
1353 ETL_CONSTEXPR14
bool all(element_type mask)
const ETL_NOEXCEPT
1355 return buffer == (All_Set_Element & mask);
1363 return buffer == All_Clear_Element;
1369 ETL_CONSTEXPR14
bool none(element_type
mask)
const ETL_NOEXCEPT
1371 return (buffer &
mask) == All_Clear_Element;
1385 ETL_CONSTEXPR14
bool any(element_type
mask)
const ETL_NOEXCEPT
1415 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
1417 const element_type
mask = element_type(element_type(1) << position);
1426 ETL_CONSTEXPR14
bool operator[] (
size_t position)
const ETL_NOEXCEPT
1428 if (position < Active_Bits)
1430 const element_type
mask = element_type(element_type(1) << position);
1431 return (buffer &
mask) != 0U;
1440 ETL_CONSTEXPR14 bit_reference
operator [] (
size_t position) ETL_NOEXCEPT
1442 return bit_reference(*
this, position);
1449 template <
typename TString = etl::
string<Active_Bits>>
1451 template <
typename TString>
1454 typename TString::value_type
one =
typename TString::value_type(
'1'))
const
1458 result.resize(Active_Bits,
'\0');
1463 for (
size_t i = Active_Bits;
i > 0; --
i)
1487 ETL_CONSTEXPR14
size_t find_next(
bool state,
size_t position)
const ETL_NOEXCEPT
1489 if (position < Active_Bits)
1492 size_t bit = position;
1494 element_type
mask = 1U << position;
1497 if ((state && (buffer != All_Clear_Element)) || (!state && (buffer != All_Set_Element)))
1500 while (
bit < Active_Bits)
1503 if (((buffer &
mask) != 0) == state)
1535 buffer &=
other.buffer;
1557 buffer |=
other.buffer;
1579 buffer ^=
other.buffer;
1613 if (
shift >= Active_Bits)
1642 if (
shift >= Active_Bits)
1659 return (
lhs.buffer ==
rhs.buffer);
1667 element_type
temp = buffer;
1668 buffer =
other.buffer;
1692 element_type buffer;
1695 template <
size_t Active_Bits,
typename TElement>
1696 ETL_CONSTANT
size_t bitset<Active_Bits, TElement, true>::Bits_Per_Element;
1698 template <
size_t Active_Bits,
typename TElement>
1699 ETL_CONSTANT
size_t bitset<Active_Bits, TElement, true>::Number_Of_Elements;
1701 template <
size_t Active_Bits,
typename TElement>
1702 ETL_CONSTANT
size_t bitset<Active_Bits, TElement, true>::Allocated_Bits;
1704 template <
size_t Active_Bits,
typename TElement>
1705 ETL_CONSTANT
typename bitset<Active_Bits, TElement, true>::element_type bitset<Active_Bits, TElement, true>::All_Set_Element;
1707 template <
size_t Active_Bits,
typename TElement>
1708 ETL_CONSTANT
typename bitset<Active_Bits, TElement, true>::element_type bitset<Active_Bits, TElement, true>::All_Clear_Element;
1710 template <
size_t Active_Bits,
typename TElement>
1711 ETL_CONSTANT
size_t bitset<Active_Bits, TElement, true>::Top_Mask_Shift;
1713 template <
size_t Active_Bits,
typename TElement>
1714 ETL_CONSTANT
typename bitset<Active_Bits, TElement, true>::element_type bitset<Active_Bits, TElement, true>::Top_Mask;
1719 template <
size_t Active_Bits,
typename TElement>
1735 typedef typename select_element_type::type element_type;
1736 typedef element_type*
pointer;
1740 static ETL_CONSTANT
size_t Number_Of_Elements = (Active_Bits % Bits_Per_Element == 0) ? Active_Bits / Bits_Per_Element : Active_Bits / Bits_Per_Element + 1;
1741 static ETL_CONSTANT
size_t Allocated_Bits = Number_Of_Elements * Bits_Per_Element;
1742 static ETL_CONSTANT
size_t Top_Mask_Shift = ((Bits_Per_Element - (Allocated_Bits - Active_Bits)) % Bits_Per_Element);
1745 static ETL_CONSTANT element_type Top_Mask = element_type(Top_Mask_Shift == 0 ? All_Set_Element : ~(All_Set_Element << Top_Mask_Shift));
1747 static ETL_CONSTANT
size_t ALLOCATED_BITS = Allocated_Bits;
1765 : p_bitset(
other.p_bitset)
1766 , position(
other.position)
1775 return p_bitset->test(position);
1783 p_bitset->set(position,
b);
1790 ETL_CONSTEXPR14 bit_reference&
operator = (
const bit_reference&
r) ETL_NOEXCEPT
1792 p_bitset->set(position,
bool(
r));
1799 ETL_CONSTEXPR14 bit_reference&
flip() ETL_NOEXCEPT
1801 p_bitset->flip(position);
1810 return !p_bitset->test(position);
1818 ETL_CONSTEXPR14 bit_reference() ETL_NOEXCEPT
1819 : p_bitset(ETL_NULLPTR)
1833 bitset<Active_Bits, TElement, false>* p_bitset;
1852 etl::copy_n(
other.buffer, Number_Of_Elements, buffer);
1862 clear_unused_bits_in_msb();
1868 ETL_CONSTEXPR14
bitset(
const char* text) ETL_NOEXCEPT
1871 ibitset.
set(buffer, Number_Of_Elements, Active_Bits, text);
1872 clear_unused_bits_in_msb();
1878 ETL_CONSTEXPR14
bitset(
const wchar_t* text) ETL_NOEXCEPT
1881 ibitset.
set(buffer, Number_Of_Elements, Active_Bits, text);
1882 clear_unused_bits_in_msb();
1888 ETL_CONSTEXPR14
bitset(
const char16_t* text) ETL_NOEXCEPT
1891 ibitset.
set(buffer, Number_Of_Elements, Active_Bits, text);
1892 clear_unused_bits_in_msb();
1898 ETL_CONSTEXPR14
bitset(
const char32_t* text) ETL_NOEXCEPT
1901 ibitset.
set(buffer, Number_Of_Elements, Active_Bits, text);
1902 clear_unused_bits_in_msb();
1910 etl::copy_n(
other.buffer, Number_Of_Elements, buffer);
1920 etl::fill_n(buffer, Number_Of_Elements, All_Set_Element);
1921 clear_unused_bits_in_msb();
1931 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
1934 clear_unused_bits_in_msb();
1944 ibitset.
set(buffer, Number_Of_Elements, Active_Bits, text);
1954 ibitset.
set(buffer, Number_Of_Elements, Active_Bits, text);
1964 ibitset.
set(buffer, Number_Of_Elements, Active_Bits, text);
1974 ibitset.
set(buffer, Number_Of_Elements, Active_Bits, text);
2022 template <
typename T>
2028 ETL_STATIC_ASSERT((
sizeof(
T) *
CHAR_BIT) >= (Number_Of_Elements * Bits_Per_Element),
"Type too small");
2053 etl::fill_n(buffer, Number_Of_Elements, All_Clear_Element);
2063 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
2074 ETL_CONSTEXPR14
bool test(
size_t position)
const
2076 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow),
false);
2078 return ibitset.
test(buffer, Number_Of_Elements, position);
2100 ETL_CONSTEXPR14
bool all()
const ETL_NOEXCEPT
2102 return ibitset.all(buffer, Number_Of_Elements, Top_Mask);
2127 clear_unused_bits_in_msb();
2137 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
2139 ibitset.
flip(buffer, Number_Of_Elements, position);
2147 ETL_CONSTEXPR14
bool operator[] (
size_t position)
const ETL_NOEXCEPT
2149 return ibitset.
test(buffer, Number_Of_Elements, position);
2155 ETL_CONSTEXPR14 bit_reference
operator [] (
size_t position) ETL_NOEXCEPT
2157 return bit_reference(*
this, position);
2164 template <
typename TString = etl::
string<Active_Bits>>
2166 template <
typename TString>
2169 typename TString::value_type
one =
typename TString::value_type(
'1'))
const
2181 return ibitset.
find_next(buffer, Number_Of_Elements, Active_Bits, state, 0);
2190 ETL_CONSTEXPR14
size_t find_next(
bool state,
size_t position)
const ETL_NOEXCEPT
2192 return ibitset.
find_next(buffer, Number_Of_Elements, Active_Bits, state, position);
2212 ibitset.and_equals(&buffer[0], &
other.buffer[0], Number_Of_Elements);
2234 ibitset.or_equals(&buffer[0], &
other.buffer[0], Number_Of_Elements);
2256 ibitset.xor_equals(&buffer[0], &
other.buffer[0], Number_Of_Elements);
2290 if (
shift >= Active_Bits)
2296 ibitset.shift_left_equals(buffer, Number_Of_Elements,
shift);
2297 clear_unused_bits_in_msb();
2320 if (
shift >= Active_Bits)
2326 ibitset.shift_right_equals(buffer, Number_Of_Elements,
shift);
2337 return etl::equal(
lhs.buffer,
2338 lhs.buffer +
lhs.Number_Of_Elements,
2356 return span_type(buffer, Number_Of_Elements);
2373 ETL_CONSTEXPR14
void clear_unused_bits_in_msb() ETL_NOEXCEPT
2375 buffer[Number_Of_Elements - 1U] &= Top_Mask;
2380 element_type buffer[Number_Of_Elements > 0U ? Number_Of_Elements : 1U];
2383 template <
size_t Active_Bits,
typename TElement>
2384 ETL_CONSTANT
size_t bitset<Active_Bits, TElement, false>::Bits_Per_Element;
2386 template <
size_t Active_Bits,
typename TElement>
2387 ETL_CONSTANT
size_t bitset<Active_Bits, TElement, false>::Number_Of_Elements;
2389 template <
size_t Active_Bits,
typename TElement>
2390 ETL_CONSTANT
size_t bitset<Active_Bits, TElement, false>::Allocated_Bits;
2392 template <
size_t Active_Bits,
typename TElement>
2393 ETL_CONSTANT
typename bitset<Active_Bits, TElement, false>::element_type bitset<Active_Bits, TElement, false>::All_Set_Element;
2395 template <
size_t Active_Bits,
typename TElement>
2396 ETL_CONSTANT
typename bitset<Active_Bits, TElement, false>::element_type bitset<Active_Bits, TElement, false>::All_Clear_Element;
2398 template <
size_t Active_Bits,
typename TElement>
2399 ETL_CONSTANT
size_t bitset<Active_Bits, TElement, false>::Top_Mask_Shift;
2401 template <
size_t Active_Bits,
typename TElement>
2402 ETL_CONSTANT
typename bitset<Active_Bits, TElement, false>::element_type bitset<Active_Bits, TElement, false>::Top_Mask;
2408 template <
size_t Active_Bits,
typename TElement,
bool IsSingleElement>
2420 template<
size_t Active_Bits,
typename TElement,
bool IsSingleElement>
2432 template<
size_t Active_Bits,
typename TElement,
bool IsSingleElement>
2444 template<
size_t Active_Bits,
typename TElement,
bool IsSingleElement>
2454template <
size_t Active_Bits,
typename TElement,
bool IsSingleElement>
2466 template <
size_t Active_Bits = 0U,
2467 typename TElement = char,
2476 class bitset_ext<0U, char, true> :
public bitset_constants<>
2484 class bitset_ext<0U, char, false> :
public bitset_constants<>
2492 template <
size_t Active_Bits,
typename TElement>
2493 class bitset_ext<Active_Bits, TElement, true> :
public bitset_constants<>
2500 typedef element_type* pointer;
2501 typedef const element_type* const_pointer;
2504 static ETL_CONSTANT
size_t Number_Of_Elements = 1U;
2505 static ETL_CONSTANT
size_t Allocated_Bits = Bits_Per_Element;
2507 static ETL_CONSTANT element_type All_Clear_Element = element_type(0);
2508 static ETL_CONSTANT
size_t Top_Mask_Shift = 0U;
2509 static ETL_CONSTANT element_type Top_Mask = All_Set_Element;
2514 typedef element_type buffer_type;
2523 friend class bitset_ext;
2529 : p_bitset(
other.p_bitset)
2530 , position(
other.position)
2539 return p_bitset->test(position);
2547 p_bitset->set(position,
b);
2554 ETL_CONSTEXPR14 bit_reference&
operator = (
const bit_reference&
r) ETL_NOEXCEPT
2556 p_bitset->set(position,
bool(
r));
2563 ETL_CONSTEXPR14 bit_reference&
flip() ETL_NOEXCEPT
2565 p_bitset->flip(position);
2574 return !p_bitset->test(position);
2582 ETL_CONSTEXPR14 bit_reference() ETL_NOEXCEPT
2583 : p_bitset(ETL_NULLPTR)
2597 bitset_ext<Active_Bits, TElement, true>* p_bitset;
2604 ETL_CONSTEXPR14 bitset_ext(element_type* pbuffer_) ETL_NOEXCEPT
2607 *pbuffer = All_Clear_Element;
2613 ETL_CONSTEXPR14 bitset_ext(buffer_type& buffer) ETL_NOEXCEPT
2616 *pbuffer = All_Clear_Element;
2622 ETL_CONSTEXPR14 bitset_ext(
const bitset_ext<Active_Bits, TElement, true>& other, element_type* pbuffer_) ETL_NOEXCEPT
2625 *pbuffer = *other.pbuffer;
2631 ETL_CONSTEXPR14 bitset_ext(
const bitset_ext<Active_Bits, TElement, true>& other, buffer_type& buffer) ETL_NOEXCEPT
2634 *pbuffer = *other.pbuffer;
2640 ETL_CONSTEXPR14 bitset_ext(
const bitset_ext<Active_Bits, TElement, true>& other) ETL_NOEXCEPT ETL_DELETE;
2645 ETL_CONSTEXPR14 bitset_ext(
unsigned long long value, element_type* pbuffer_) ETL_NOEXCEPT
2648 *pbuffer = element_type(value);
2654 ETL_CONSTEXPR14 bitset_ext(
unsigned long long value, buffer_type& buffer) ETL_NOEXCEPT
2657 *pbuffer = element_type(value);
2663 ETL_CONSTEXPR14 bitset_ext(
const char* text, element_type* pbuffer_) ETL_NOEXCEPT
2666 *pbuffer = All_Clear_Element;
2673 ETL_CONSTEXPR14 bitset_ext(
const char* text, buffer_type& buffer) ETL_NOEXCEPT
2676 *pbuffer = All_Clear_Element;
2683 ETL_CONSTEXPR14 bitset_ext(
const wchar_t* text, element_type* pbuffer_) ETL_NOEXCEPT
2686 *pbuffer = All_Clear_Element;
2693 ETL_CONSTEXPR14 bitset_ext(
const wchar_t* text, buffer_type& buffer) ETL_NOEXCEPT
2696 *pbuffer = All_Clear_Element;
2703 ETL_CONSTEXPR14 bitset_ext(
const char16_t* text, element_type* pbuffer_) ETL_NOEXCEPT
2706 *pbuffer = All_Clear_Element;
2713 ETL_CONSTEXPR14 bitset_ext(
const char16_t* text, buffer_type& buffer) ETL_NOEXCEPT
2716 *pbuffer = All_Clear_Element;
2723 ETL_CONSTEXPR14 bitset_ext(
const char32_t* text, element_type* pbuffer_) ETL_NOEXCEPT
2726 *pbuffer = All_Clear_Element;
2733 ETL_CONSTEXPR14 bitset_ext(
const char32_t* text, buffer_type& buffer) ETL_NOEXCEPT
2736 *pbuffer = All_Clear_Element;
2743 ETL_CONSTEXPR14 bitset_ext& operator =(
const bitset_ext<Active_Bits, TElement, true>& other) ETL_NOEXCEPT
2745 *pbuffer = *other.pbuffer;
2753 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& set() ETL_NOEXCEPT
2755 *pbuffer = All_Set_Element;
2763 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& set(
size_t position,
bool value =
true)
2765 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(bitset_overflow), *
this);
2767 const element_type mask = element_type(element_type(1) << position);
2783 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& set(
const char* text) ETL_NOEXCEPT
2793 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& set(
const wchar_t* text) ETL_NOEXCEPT
2803 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& set(
const char16_t* text) ETL_NOEXCEPT
2813 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& set(
const char32_t* text) ETL_NOEXCEPT
2823 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& from_string(
const char* text) ETL_NOEXCEPT
2825 if (text == ETL_NULLPTR)
2834 string_length = etl::min(Active_Bits, string_length);
2836 element_type mask = element_type(element_type(1) << (string_length - 1U));
2838 for (
size_t i = 0U; i < string_length; ++i)
2840 if (text[i] == ETL_STR(
'1'))
2859 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& from_string(
const wchar_t* text) ETL_NOEXCEPT
2861 if (text == ETL_NULLPTR)
2870 string_length = etl::min(Active_Bits, string_length);
2872 element_type mask = element_type(element_type(1) << (string_length - 1U));
2874 for (
size_t i = 0U; i < string_length; ++i)
2876 if (text[i] == ETL_STRL(
'1'))
2895 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& from_string(
const char16_t* text) ETL_NOEXCEPT
2897 if (text == ETL_NULLPTR)
2906 string_length = etl::min(Active_Bits, string_length);
2908 element_type mask = element_type(element_type(1) << (string_length - 1U));
2910 for (
size_t i = 0U; i < string_length; ++i)
2912 if (text[i] == ETL_STRu(
'1'))
2931 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& from_string(
const char32_t* text) ETL_NOEXCEPT
2933 if (text == ETL_NULLPTR)
2942 string_length = etl::min(Active_Bits, string_length);
2944 element_type mask = element_type(element_type(1) << (string_length - 1U));
2946 for (
size_t i = 0U; i < string_length; ++i)
2948 if (text[i] == ETL_STRU(
'1'))
2967 template <
typename T>
2970 value() const ETL_NOEXCEPT
2973 ETL_STATIC_ASSERT((
sizeof(T) * CHAR_BIT) >= (Number_Of_Elements * Bits_Per_Element),
"Integral type too small");
2977 const bool OK = (
sizeof(T) * CHAR_BIT) >= Bits_Per_Element;
2990 ETL_CONSTEXPR14
unsigned long to_ulong() const ETL_NOEXCEPT
2992 return value<unsigned long>();
2998 ETL_CONSTEXPR14
unsigned long long to_ullong() const ETL_NOEXCEPT
3000 return value<unsigned long long>();
3006 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& reset() ETL_NOEXCEPT
3008 *pbuffer = All_Clear_Element;
3016 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& reset(
size_t position)
3018 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(bitset_overflow), *
this);
3020 const element_type mask = element_type(element_type(1) << position);
3030 ETL_CONSTEXPR14
bool test(
size_t position)
const
3032 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(bitset_overflow),
false);
3034 const element_type mask = element_type(element_type(1) << position);
3035 return (*pbuffer & mask) != 0U;
3043 ETL_CONSTEXPR14
size_t size() const ETL_NOEXCEPT
3051 ETL_CONSTEXPR14
size_t count() const ETL_NOEXCEPT
3059 ETL_CONSTEXPR14
bool all() const ETL_NOEXCEPT
3061 return *pbuffer == All_Set_Element;
3067 ETL_CONSTEXPR14
bool all(element_type mask)
const ETL_NOEXCEPT
3069 return *pbuffer == (All_Set_Element & mask);
3075 ETL_CONSTEXPR14
bool none() const ETL_NOEXCEPT
3077 return *pbuffer == All_Clear_Element;
3083 ETL_CONSTEXPR14
bool none(element_type mask)
const ETL_NOEXCEPT
3085 return (*pbuffer & mask) == All_Clear_Element;
3091 ETL_CONSTEXPR14
bool any() const ETL_NOEXCEPT
3099 ETL_CONSTEXPR14
bool any(element_type mask)
const ETL_NOEXCEPT
3107 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& flip() ETL_NOEXCEPT
3109 *pbuffer = ~*pbuffer;
3127 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>& flip(
size_t position)
3129 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(bitset_overflow), *
this);
3131 const element_type mask = element_type(element_type(1) << position);
3140 ETL_CONSTEXPR14
bool operator[] (
size_t position)
const ETL_NOEXCEPT
3142 if (position < Active_Bits)
3144 const element_type mask = element_type(element_type(1) << position);
3145 return (*pbuffer & mask) != 0U;
3154 ETL_CONSTEXPR14 bit_reference operator [] (
size_t position) ETL_NOEXCEPT
3156 return bit_reference(*
this, position);
3163 template <
typename TString = etl::
string<Active_Bits>>
3165 template <
typename TString>
3167 ETL_CONSTEXPR14 TString
to_string(
typename TString::value_type zero =
typename TString::value_type(
'0'),
3168 typename TString::value_type one =
typename TString::value_type(
'1'))
const
3172 result.resize(Active_Bits,
'\0');
3177 for (
size_t i = Active_Bits; i > 0; --i)
3179 result[Active_Bits - i] = test(i - 1) ? one : zero;
3190 ETL_CONSTEXPR14
size_t find_first(
bool state)
const ETL_NOEXCEPT
3192 return find_next(state, 0U);
3201 ETL_CONSTEXPR14
size_t find_next(
bool state,
size_t position)
const ETL_NOEXCEPT
3203 if (position < Active_Bits)
3206 size_t bit = position;
3208 element_type mask = 1U << position;
3211 if ((state && (*pbuffer != All_Clear_Element)) || (!state && (*pbuffer != All_Set_Element)))
3214 while (bit < Active_Bits)
3217 if (((*pbuffer & mask) != 0) == state)
3235 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>&
operator &=(
const bitset_ext<Active_Bits, TElement, true>& other) ETL_NOEXCEPT
3237 *pbuffer &= *other.pbuffer;
3245 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>&
operator |=(
const bitset_ext<Active_Bits, TElement, true>& other) ETL_NOEXCEPT
3247 *pbuffer |= *other.pbuffer;
3255 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>&
operator ^=(
const bitset_ext<Active_Bits, TElement, true>& other) ETL_NOEXCEPT
3257 *pbuffer ^= *other.pbuffer;
3265 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>&
operator <<=(
size_t shift) ETL_NOEXCEPT
3267 if (shift >= Active_Bits)
3282 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, true>&
operator >>=(
size_t shift) ETL_NOEXCEPT
3284 if (shift >= Active_Bits)
3299 friend ETL_CONSTEXPR14
bool operator ==(
const bitset_ext<Active_Bits, TElement, true>& lhs,
const bitset_ext<Active_Bits, TElement, true>& rhs) ETL_NOEXCEPT
3301 return (*lhs.pbuffer == *rhs.pbuffer);
3309 element_type temp = *pbuffer;
3310 *pbuffer = *other.pbuffer;
3311 *other.pbuffer = temp;
3318 ETL_CONSTEXPR14 span_type span() ETL_NOEXCEPT
3320 return span_type(pbuffer, 1);
3327 ETL_CONSTEXPR14 const_span_type span() const ETL_NOEXCEPT
3329 return const_span_type(pbuffer, 1);
3334 element_type* pbuffer;
3337 template <
size_t Active_Bits,
typename TElement>
3338 ETL_CONSTANT
size_t bitset_ext<Active_Bits, TElement, true>::Bits_Per_Element;
3340 template <
size_t Active_Bits,
typename TElement>
3341 ETL_CONSTANT
size_t bitset_ext<Active_Bits, TElement, true>::Number_Of_Elements;
3343 template <
size_t Active_Bits,
typename TElement>
3344 ETL_CONSTANT
size_t bitset_ext<Active_Bits, TElement, true>::Allocated_Bits;
3346 template <
size_t Active_Bits,
typename TElement>
3347 ETL_CONSTANT
typename bitset_ext<Active_Bits, TElement, true>::element_type bitset_ext<Active_Bits, TElement, true>::All_Set_Element;
3349 template <
size_t Active_Bits,
typename TElement>
3350 ETL_CONSTANT
typename bitset_ext<Active_Bits, TElement, true>::element_type bitset_ext<Active_Bits, TElement, true>::All_Clear_Element;
3352 template <
size_t Active_Bits,
typename TElement>
3353 ETL_CONSTANT
size_t bitset_ext<Active_Bits, TElement, true>::Top_Mask_Shift;
3355 template <
size_t Active_Bits,
typename TElement>
3356 ETL_CONSTANT
typename bitset_ext<Active_Bits, TElement, true>::element_type bitset_ext<Active_Bits, TElement, true>::Top_Mask;
3361 template <
size_t Active_Bits,
typename TElement>
3362 class bitset_ext<Active_Bits, TElement, false> :
public bitset_constants<>
3370 struct select_element_type
3377 typedef typename select_element_type::type element_type;
3378 typedef element_type* pointer;
3379 typedef const element_type* const_pointer;
3382 static ETL_CONSTANT
size_t Number_Of_Elements = (Active_Bits % Bits_Per_Element == 0) ? Active_Bits / Bits_Per_Element : Active_Bits / Bits_Per_Element + 1;
3383 static ETL_CONSTANT
size_t Allocated_Bits = Number_Of_Elements * Bits_Per_Element;
3384 static ETL_CONSTANT
size_t Top_Mask_Shift = ((Bits_Per_Element - (Allocated_Bits - Active_Bits)) % Bits_Per_Element);
3387 static ETL_CONSTANT element_type Top_Mask = element_type(Top_Mask_Shift == 0 ? All_Set_Element : ~(All_Set_Element << Top_Mask_Shift));
3389 static ETL_CONSTANT
size_t ALLOCATED_BITS = Allocated_Bits;
3403 friend class bitset_ext;
3409 : p_bitset(
other.p_bitset)
3410 , position(
other.position)
3419 return p_bitset->test(position);
3427 p_bitset->set(position,
b);
3434 ETL_CONSTEXPR14 bit_reference&
operator = (
const bit_reference&
r) ETL_NOEXCEPT
3436 p_bitset->set(position,
bool(
r));
3443 ETL_CONSTEXPR14 bit_reference&
flip() ETL_NOEXCEPT
3445 p_bitset->flip(position);
3454 return !p_bitset->test(position);
3462 ETL_CONSTEXPR14 bit_reference() ETL_NOEXCEPT
3463 : p_bitset(ETL_NULLPTR)
3477 bitset_ext<Active_Bits, TElement, false>* p_bitset;
3484 ETL_CONSTEXPR14 bitset_ext(element_type* pbuffer_) ETL_NOEXCEPT
3493 ETL_CONSTEXPR14 bitset_ext(buffer_type& buffer) ETL_NOEXCEPT
3494 : pbuffer(buffer.data())
3502 ETL_CONSTEXPR14 bitset_ext(
const bitset_ext<Active_Bits, TElement, false>& other, element_type* pbuffer_) ETL_NOEXCEPT
3505 etl::copy_n(other.pbuffer, Number_Of_Elements, pbuffer);
3511 ETL_CONSTEXPR14 bitset_ext(
const bitset_ext<Active_Bits, TElement, false>& other, buffer_type& buffer) ETL_NOEXCEPT
3512 : pbuffer(buffer.data())
3514 etl::copy_n(other.pbuffer, Number_Of_Elements, pbuffer);
3520 ETL_CONSTEXPR14 bitset_ext(
const bitset_ext<Active_Bits, TElement, false>& other) ETL_NOEXCEPT ETL_DELETE;
3525 ETL_CONSTEXPR14 bitset_ext(
unsigned long long value, element_type* pbuffer_) ETL_NOEXCEPT
3528 ibitset.initialise(pbuffer, Number_Of_Elements, value);
3529 clear_unused_bits_in_msb();
3535 ETL_CONSTEXPR14 bitset_ext(
unsigned long long value, buffer_type& buffer) ETL_NOEXCEPT
3536 : pbuffer(buffer.data())
3538 ibitset.initialise(pbuffer, Number_Of_Elements, value);
3539 clear_unused_bits_in_msb();
3545 ETL_CONSTEXPR14 bitset_ext(
const char* text, element_type* pbuffer_) ETL_NOEXCEPT
3548 ibitset.set(pbuffer, Number_Of_Elements, Active_Bits, text);
3549 clear_unused_bits_in_msb();
3555 ETL_CONSTEXPR14 bitset_ext(
const char* text, buffer_type& buffer) ETL_NOEXCEPT
3556 : pbuffer(buffer.data())
3558 ibitset.set(pbuffer, Number_Of_Elements, Active_Bits, text);
3559 clear_unused_bits_in_msb();
3565 ETL_CONSTEXPR14 bitset_ext(
const wchar_t* text, element_type* pbuffer_) ETL_NOEXCEPT
3568 ibitset.set(pbuffer, Number_Of_Elements, Active_Bits, text);
3569 clear_unused_bits_in_msb();
3575 ETL_CONSTEXPR14 bitset_ext(
const wchar_t* text, buffer_type& buffer) ETL_NOEXCEPT
3576 : pbuffer(buffer.data())
3578 ibitset.set(pbuffer, Number_Of_Elements, Active_Bits, text);
3579 clear_unused_bits_in_msb();
3585 ETL_CONSTEXPR14 bitset_ext(
const char16_t* text, element_type* pbuffer_) ETL_NOEXCEPT
3588 ibitset.set(pbuffer, Number_Of_Elements, Active_Bits, text);
3589 clear_unused_bits_in_msb();
3595 ETL_CONSTEXPR14 bitset_ext(
const char16_t* text, buffer_type& buffer) ETL_NOEXCEPT
3596 : pbuffer(buffer.data())
3598 ibitset.set(pbuffer, Number_Of_Elements, Active_Bits, text);
3599 clear_unused_bits_in_msb();
3605 ETL_CONSTEXPR14 bitset_ext(
const char32_t* text, element_type* pbuffer_) ETL_NOEXCEPT
3608 ibitset.set(pbuffer, Number_Of_Elements, Active_Bits, text);
3609 clear_unused_bits_in_msb();
3615 ETL_CONSTEXPR14 bitset_ext(
const char32_t* text, buffer_type& buffer) ETL_NOEXCEPT
3616 : pbuffer(buffer.data())
3618 ibitset.set(pbuffer, Number_Of_Elements, Active_Bits, text);
3619 clear_unused_bits_in_msb();
3625 ETL_CONSTEXPR14 bitset_ext& operator =(
const bitset_ext<Active_Bits, TElement, false>& other) ETL_NOEXCEPT
3627 etl::copy_n(other.pbuffer, Number_Of_Elements, pbuffer);
3635 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& set() ETL_NOEXCEPT
3637 etl::fill_n(pbuffer, Number_Of_Elements, All_Set_Element);
3638 clear_unused_bits_in_msb();
3646 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& set(
size_t position,
bool value =
true)
3648 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(bitset_overflow), *
this);
3650 ibitset.set(pbuffer, Number_Of_Elements, position, value);
3651 clear_unused_bits_in_msb();
3659 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& set(
const char* text) ETL_NOEXCEPT
3661 ibitset.set(pbuffer, Number_Of_Elements, Active_Bits, text);
3669 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& set(
const wchar_t* text) ETL_NOEXCEPT
3671 ibitset.set(pbuffer, Number_Of_Elements, Active_Bits, text);
3679 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& set(
const char16_t* text) ETL_NOEXCEPT
3681 ibitset.set(pbuffer, Number_Of_Elements, Active_Bits, text);
3689 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& set(
const char32_t* text) ETL_NOEXCEPT
3691 ibitset.set(pbuffer, Number_Of_Elements, Active_Bits, text);
3699 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& from_string(
const char* text) ETL_NOEXCEPT
3701 ibitset.from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
3709 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& from_string(
const wchar_t* text) ETL_NOEXCEPT
3711 ibitset.from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
3719 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& from_string(
const char16_t* text) ETL_NOEXCEPT
3721 ibitset.from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
3729 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& from_string(
const char32_t* text) ETL_NOEXCEPT
3731 ibitset.from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
3739 template <
typename T>
3742 value() const ETL_NOEXCEPT
3745 ETL_STATIC_ASSERT((
sizeof(T) * CHAR_BIT) >= (Number_Of_Elements * Bits_Per_Element),
"Type too small");
3747 return ibitset.template value<T>(pbuffer, Number_Of_Elements);
3753 ETL_CONSTEXPR14
unsigned long to_ulong() const ETL_NOEXCEPT
3755 return value<unsigned long>();
3761 ETL_CONSTEXPR14
unsigned long long to_ullong() const ETL_NOEXCEPT
3763 return value<unsigned long long>();
3768 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& reset() ETL_NOEXCEPT
3770 etl::fill_n(pbuffer, Number_Of_Elements, All_Clear_Element);
3778 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& reset(
size_t position)
3780 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(bitset_overflow), *
this);
3782 ibitset.reset(pbuffer, Number_Of_Elements, position);
3791 ETL_CONSTEXPR14
bool test(
size_t position)
const
3793 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(bitset_overflow),
false);
3795 return ibitset.test(pbuffer, Number_Of_Elements, position);
3801 ETL_CONSTEXPR14
size_t size() const ETL_NOEXCEPT
3809 ETL_CONSTEXPR14
size_t count() const ETL_NOEXCEPT
3811 return ibitset.count(pbuffer, Number_Of_Elements);
3817 ETL_CONSTEXPR14
bool all() const ETL_NOEXCEPT
3819 return ibitset.all(pbuffer, Number_Of_Elements, Top_Mask);
3825 ETL_CONSTEXPR14
bool none() const ETL_NOEXCEPT
3827 return ibitset.none(pbuffer, Number_Of_Elements);
3833 ETL_CONSTEXPR14
bool any() const ETL_NOEXCEPT
3841 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& flip() ETL_NOEXCEPT
3843 ibitset.flip(pbuffer, Number_Of_Elements);
3844 clear_unused_bits_in_msb();
3852 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>& flip(
size_t position)
3854 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(bitset_overflow), *
this);
3856 ibitset.flip(pbuffer, Number_Of_Elements, position);
3864 ETL_CONSTEXPR14
bool operator[] (
size_t position)
const ETL_NOEXCEPT
3866 return ibitset.test(pbuffer, Number_Of_Elements, position);
3872 ETL_CONSTEXPR14 bit_reference operator [] (
size_t position) ETL_NOEXCEPT
3874 return bit_reference(*
this, position);
3881 template <
typename TString = etl::
string<Active_Bits>>
3883 template <
typename TString>
3885 ETL_CONSTEXPR14 TString
to_string(
typename TString::value_type zero =
typename TString::value_type(
'0'),
3886 typename TString::value_type one =
typename TString::value_type(
'1'))
const
3888 return ibitset.template to_string<TString>(pbuffer, Number_Of_Elements, Active_Bits, zero, one);
3896 ETL_CONSTEXPR14
size_t find_first(
bool state)
const ETL_NOEXCEPT
3898 return ibitset.find_next(pbuffer, Number_Of_Elements, Active_Bits, state, 0);
3907 ETL_CONSTEXPR14
size_t find_next(
bool state,
size_t position)
const ETL_NOEXCEPT
3909 return ibitset.find_next(pbuffer, Number_Of_Elements, Active_Bits, state, position);
3915 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>&
operator &=(
const bitset_ext<Active_Bits, TElement, false>& other) ETL_NOEXCEPT
3917 ibitset.and_equals(&pbuffer[0], &other.pbuffer[0], Number_Of_Elements);
3925 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>&
operator |=(
const bitset_ext<Active_Bits, TElement, false>& other) ETL_NOEXCEPT
3927 ibitset.or_equals(&pbuffer[0], &other.pbuffer[0], Number_Of_Elements);
3935 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>&
operator ^=(
const bitset_ext<Active_Bits, TElement, false>& other) ETL_NOEXCEPT
3937 ibitset.xor_equals(&pbuffer[0], &other.pbuffer[0], Number_Of_Elements);
3945 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>&
operator <<=(
size_t shift) ETL_NOEXCEPT
3947 if (shift >= Active_Bits)
3953 ibitset.shift_left_equals(pbuffer, Number_Of_Elements, shift);
3954 clear_unused_bits_in_msb();
3963 ETL_CONSTEXPR14 bitset_ext<Active_Bits, TElement, false>&
operator >>=(
size_t shift) ETL_NOEXCEPT
3965 if (shift >= Active_Bits)
3971 ibitset.shift_right_equals(pbuffer, Number_Of_Elements, shift);
3980 friend ETL_CONSTEXPR14
bool operator ==(
const bitset_ext<Active_Bits, TElement, false>& lhs,
const bitset_ext<Active_Bits, TElement, false>& rhs) ETL_NOEXCEPT
3982 return etl::equal(lhs.pbuffer,
3983 lhs.pbuffer + lhs.Number_Of_Elements,
3992 ibitset.swap(pbuffer, other.pbuffer, Number_Of_Elements);
3999 ETL_CONSTEXPR14 span_type span() ETL_NOEXCEPT
4001 return span_type(pbuffer, Number_Of_Elements);
4008 ETL_CONSTEXPR14 const_span_type span() const ETL_NOEXCEPT
4010 return const_span_type(pbuffer, Number_Of_Elements);
4018 ETL_CONSTEXPR14
void clear_unused_bits_in_msb() ETL_NOEXCEPT
4020 pbuffer[Number_Of_Elements - 1U] &= Top_Mask;
4024 element_type* pbuffer;
4027 template <
size_t Active_Bits,
typename TElement>
4028 ETL_CONSTANT
size_t bitset_ext<Active_Bits, TElement, false>::Bits_Per_Element;
4030 template <
size_t Active_Bits,
typename TElement>
4031 ETL_CONSTANT
size_t bitset_ext<Active_Bits, TElement, false>::Number_Of_Elements;
4033 template <
size_t Active_Bits,
typename TElement>
4034 ETL_CONSTANT
size_t bitset_ext<Active_Bits, TElement, false>::Allocated_Bits;
4036 template <
size_t Active_Bits,
typename TElement>
4037 ETL_CONSTANT
typename bitset_ext<Active_Bits, TElement, false>::element_type bitset_ext<Active_Bits, TElement, false>::All_Set_Element;
4039 template <
size_t Active_Bits,
typename TElement>
4040 ETL_CONSTANT
typename bitset_ext<Active_Bits, TElement, false>::element_type bitset_ext<Active_Bits, TElement, false>::All_Clear_Element;
4042 template <
size_t Active_Bits,
typename TElement>
4043 ETL_CONSTANT
size_t bitset_ext<Active_Bits, TElement, false>::Top_Mask_Shift;
4045 template <
size_t Active_Bits,
typename TElement>
4046 ETL_CONSTANT
typename bitset_ext<Active_Bits, TElement, false>::element_type bitset_ext<Active_Bits, TElement, false>::Top_Mask;
4052 template<
size_t Active_Bits,
typename TElement,
bool IsSingleElement>
4053 ETL_CONSTEXPR14
bool operator != (
const bitset_ext<Active_Bits, TElement, IsSingleElement>& lhs,
const bitset_ext<Active_Bits, TElement, IsSingleElement>& rhs) ETL_NOEXCEPT
4055 return !(lhs == rhs);
4062template <
size_t Active_Bits,
typename TElement,
bool IsSingleElement>
ETL_CONSTEXPR14 void swap(etl::bitset< Active_Bits, TElement, IsSingleElement > &lhs, etl::bitset< Active_Bits, TElement, IsSingleElement > &rhs) ETL_NOEXCEPT
swap
Definition bitset_new.h:2455
ETL_CONSTEXPR14 bool operator~() const ETL_NOEXCEPT
Return the logical inverse of the bit.
Definition bitset_new.h:1808
ETL_CONSTEXPR14 bit_reference & flip() ETL_NOEXCEPT
Flip the bit.
Definition bitset_new.h:1799
ETL_CONSTEXPR14 bit_reference(const bit_reference &other) ETL_NOEXCEPT
Copy constructor.
Definition bitset_new.h:1764
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & set(size_t position, bool value=true)
Set the bit at the position.
Definition bitset_new.h:1929
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & flip() ETL_NOEXCEPT
Flip all of the bits.
Definition bitset_new.h:2124
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & from_string(const char *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1982
ETL_CONSTEXPR14 bitset(const char32_t *text) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:1898
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & set(const char *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1942
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & from_string(const wchar_t *text) ETL_NOEXCEPT
Set from a wide string.
Definition bitset_new.h:1992
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & set(const char32_t *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1972
ETL_CONSTEXPR14 bitset(unsigned long long value) ETL_NOEXCEPT
Construct from a value.
Definition bitset_new.h:1858
ETL_CONSTEXPR14 bitset(const wchar_t *text) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:1878
ETL_CONSTEXPR14 bool test(size_t position) const
Definition bitset_new.h:2074
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & from_string(const char32_t *text) ETL_NOEXCEPT
Set from a u32 string.
Definition bitset_new.h:2012
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & flip(size_t position)
Flip the bit at the position.
Definition bitset_new.h:2135
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & reset() ETL_NOEXCEPT
Reset all of the bits.
Definition bitset_new.h:2051
ETL_CONSTEXPR14 bitset(const char16_t *text) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:1888
ETL_CONSTEXPR14 unsigned long long to_ullong() const ETL_NOEXCEPT
Get as an unsigned long long.
Definition bitset_new.h:2044
ETL_CONSTEXPR14 unsigned long to_ulong() const ETL_NOEXCEPT
Get as an unsigned long.
Definition bitset_new.h:2036
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & set(const char16_t *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1962
ETL_CONSTEXPR14 bool none() const ETL_NOEXCEPT
Are none of the bits set?
Definition bitset_new.h:2108
ETL_CONSTEXPR14 bool any() const ETL_NOEXCEPT
Are any of the bits set?
Definition bitset_new.h:2116
ETL_CONSTEXPR14 bitset(const char *text) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:1868
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & set(const wchar_t *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1952
ETL_CONSTEXPR14 size_t find_first(bool state) const ETL_NOEXCEPT
Definition bitset_new.h:2179
ETL_CONSTEXPR14 span_type span() ETL_NOEXCEPT
Definition bitset_new.h:2354
ETL_CONSTEXPR14 void swap(etl::bitset< Active_Bits, TElement, false > &other) ETL_NOEXCEPT
swap
Definition bitset_new.h:2345
ETL_CONSTEXPR14 size_t count() const ETL_NOEXCEPT
Count the number of bits set.
Definition bitset_new.h:2092
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & set() ETL_NOEXCEPT
Set all of the bits.
Definition bitset_new.h:1918
ETL_CONSTEXPR14 const_span_type span() const ETL_NOEXCEPT
Definition bitset_new.h:2363
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & reset(size_t position)
Reset the bit at the position.
Definition bitset_new.h:2061
ETL_CONSTEXPR14 size_t find_next(bool state, size_t position) const ETL_NOEXCEPT
Definition bitset_new.h:2190
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, false > & from_string(const char16_t *text) ETL_NOEXCEPT
Set from a u16 string.
Definition bitset_new.h:2002
ETL_CONSTEXPR14 etl::enable_if< etl::is_integral< T >::value, T >::type value() const ETL_NOEXCEPT
Get as an integral value.
Definition bitset_new.h:2025
ETL_CONSTEXPR14 bitset() ETL_NOEXCEPT
Default constructor.
Definition bitset_new.h:1840
ETL_CONSTEXPR14 bitset(const bitset< Active_Bits, TElement, false > &other) ETL_NOEXCEPT
Copy constructor.
Definition bitset_new.h:1849
ETL_CONSTEXPR14 TString to_string(typename TString::value_type zero=typename TString::value_type('0'), typename TString::value_type one=typename TString::value_type('1')) const
Returns a string representing the bitset.
Definition bitset_new.h:2168
ETL_CONSTEXPR14 size_t size() const ETL_NOEXCEPT
The number of bits in the bitset.
Definition bitset_new.h:2084
ETL_CONSTEXPR14 bit_reference & flip() ETL_NOEXCEPT
Flip the bit.
Definition bitset_new.h:918
ETL_CONSTEXPR14 bool operator~() const ETL_NOEXCEPT
Return the logical inverse of the bit.
Definition bitset_new.h:927
ETL_CONSTEXPR14 bit_reference(const bit_reference &other) ETL_NOEXCEPT
Copy constructor.
Definition bitset_new.h:883
ETL_CONSTEXPR14 bool any() const ETL_NOEXCEPT
Are any of the bits set?
Definition bitset_new.h:1377
ETL_CONSTEXPR14 bitset(const char16_t *text) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:1001
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & set(size_t position, bool value=true)
Set the bit at the position.
Definition bitset_new.h:1049
ETL_CONSTEXPR14 bitset(const bitset< Active_Bits, TElement, true > &other) ETL_NOEXCEPT
Copy constructor.
Definition bitset_new.h:967
ETL_CONSTEXPR14 void swap(etl::bitset< Active_Bits, TElement, true > &other) ETL_NOEXCEPT
swap
Definition bitset_new.h:1665
ETL_CONSTEXPR14 bitset(unsigned long long value) ETL_NOEXCEPT
Construct from a value.
Definition bitset_new.h:975
ETL_CONSTEXPR14 size_t count() const ETL_NOEXCEPT
Count the number of bits set.
Definition bitset_new.h:1337
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & set() ETL_NOEXCEPT
Set all of the bits.
Definition bitset_new.h:1029
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & from_string(const wchar_t *text) ETL_NOEXCEPT
Set from a wide string.
Definition bitset_new.h:1145
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & flip() ETL_NOEXCEPT
Flip all of the bits.
Definition bitset_new.h:1393
ETL_CONSTEXPR14 bool none(element_type mask) const ETL_NOEXCEPT
Are none of the bits set?
Definition bitset_new.h:1369
ETL_CONSTEXPR14 bool none() const ETL_NOEXCEPT
Are none of the bits set?
Definition bitset_new.h:1361
ETL_CONSTEXPR14 size_t find_first(bool state) const ETL_NOEXCEPT
Definition bitset_new.h:1476
ETL_CONSTEXPR14 size_t size() const ETL_NOEXCEPT
The number of bits in the bitset.
Definition bitset_new.h:1329
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & set(const wchar_t *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1079
ETL_CONSTEXPR14 bool any(element_type mask) const ETL_NOEXCEPT
Are any of the bits set?
Definition bitset_new.h:1385
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & set(element_type value) ETL_NOEXCEPT
Set from a value.
Definition bitset_new.h:1039
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & set(const char *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1069
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & set(const char16_t *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1089
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & set(const char32_t *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1099
ETL_CONSTEXPR14 etl::enable_if< etl::is_integral< T >::value, T >::type value() const ETL_NOEXCEPT
Get as an integral value.
Definition bitset_new.h:1256
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & from_string(const char16_t *text) ETL_NOEXCEPT
Set from a u16 string.
Definition bitset_new.h:1181
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & from_string(const char32_t *text) ETL_NOEXCEPT
Set from a u32 string.
Definition bitset_new.h:1217
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & from_string(const char *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1109
ETL_CONSTEXPR14 bitset(const wchar_t *text) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:992
ETL_CONSTEXPR14 bitset() ETL_NOEXCEPT
Default constructor.
Definition bitset_new.h:959
ETL_CONSTEXPR14 bitset(const char *text) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:983
ETL_CONSTEXPR14 TString to_string(typename TString::value_type zero=typename TString::value_type('0'), typename TString::value_type one=typename TString::value_type('1')) const
Returns a string representing the bitset.
Definition bitset_new.h:1453
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & reset(size_t position)
Reset the bit at the position.
Definition bitset_new.h:1302
ETL_CONSTEXPR14 bool test(size_t position) const
Definition bitset_new.h:1316
ETL_CONSTEXPR14 bitset(const char32_t *text) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:1010
ETL_CONSTEXPR14 unsigned long to_ulong() const ETL_NOEXCEPT
Get as an unsigned long.
Definition bitset_new.h:1276
ETL_CONSTEXPR14 const_span_type span() const ETL_NOEXCEPT
Definition bitset_new.h:1685
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & flip(size_t position)
Flip the bit at the position.
Definition bitset_new.h:1413
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & reset() ETL_NOEXCEPT
Reset all of the bits.
Definition bitset_new.h:1292
ETL_CONSTEXPR14 size_t find_next(bool state, size_t position) const ETL_NOEXCEPT
Definition bitset_new.h:1487
ETL_CONSTEXPR14 unsigned long long to_ullong() const ETL_NOEXCEPT
Get as an unsigned long long.
Definition bitset_new.h:1284
ETL_CONSTEXPR14 bitset< Active_Bits, TElement, true > & flip_bits(element_type mask=etl::integral_limits< element_type >::max) ETL_NOEXCEPT
Flip some of the bits.
Definition bitset_new.h:1403
ETL_CONSTEXPR14 span_type span() ETL_NOEXCEPT
Definition bitset_new.h:1676
ETL_CONSTEXPR14 bit_reference(const bit_reference &other) ETL_NOEXCEPT
Copy constructor.
Definition bitset_new.h:3408
ETL_CONSTEXPR14 bit_reference & flip() ETL_NOEXCEPT
Flip the bit.
Definition bitset_new.h:3443
ETL_CONSTEXPR14 bool operator~() const ETL_NOEXCEPT
Return the logical inverse of the bit.
Definition bitset_new.h:3452
ETL_CONSTEXPR14 bit_reference(const bit_reference &other) ETL_NOEXCEPT
Copy constructor.
Definition bitset_new.h:2528
ETL_CONSTEXPR14 bit_reference & flip() ETL_NOEXCEPT
Flip the bit.
Definition bitset_new.h:2563
ETL_CONSTEXPR14 bool operator~() const ETL_NOEXCEPT
Return the logical inverse of the bit.
Definition bitset_new.h:2572
bit_reference & operator=(bool b)
Assignment operator.
Definition bitset_legacy.h:198
A templated set implementation that uses a fixed size buffer.
Definition set.h:2502
ETL_CONSTEXPR14 etl::enable_if< etl::is_integral< T >::value &&etl::is_unsigned< T >::value &&(etl::integral_limits< T >::bits==16U), uint_least8_t >::type count_bits(T value)
Definition binary.h:956
ETL_CONSTEXPR14 bool test(const_pointer pbuffer, size_t number_of_elements, size_t position) const ETL_NOEXCEPT
Definition bitset_new.h:167
ibitset & set()
Set all bits.
Definition bitset_legacy.h:312
ibitset & reset()
Resets the bitset.
Definition bitset_legacy.h:513
bitset< MaxN > & operator&=(const bitset< MaxN > &other)
operator &=
Definition bitset_legacy.h:1367
ETL_CONSTEXPR14 void flip(pointer pbuffer, size_t number_of_elements, size_t position) ETL_NOEXCEPT
Flip the bit at the position.
Definition bitset_new.h:438
ETL_CONSTEXPR14 void from_string(pointer pbuffer, size_t number_of_elements, size_t total_bits, const wchar_t *text) ETL_NOEXCEPT
Set from a wide string.
Definition bitset_new.h:253
size_t find_next(bool state, size_t position) const
Definition bitset_legacy.h:664
ibitset & initialise(unsigned long long value)
Initialise from an unsigned long long.
Definition bitset_legacy.h:983
ETL_CONSTEXPR14 void flip(pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
Flip all of the bits.
Definition bitset_new.h:427
ETL_CONSTEXPR14 TString to_string(const_pointer pbuffer, size_t number_of_elements, size_t active_bits, typename TString::value_type zero, typename TString::value_type one) const
Returns a string representing the bitset.
Definition bitset_new.h:572
friend bool operator==(const bitset< MaxN > &lhs, const bitset< MaxN > &rhs)
operator ==
Definition bitset_legacy.h:1448
ETL_CONSTEXPR14 size_t find_next(const_pointer pbuffer, size_t number_of_elements, size_t total_bits, bool state, size_t position) const ETL_NOEXCEPT
Definition bitset_new.h:521
ETL_CONSTEXPR14 size_t count(const_pointer pbuffer, size_t number_of_elements) const ETL_NOEXCEPT
Count the number of bits set.
Definition bitset_new.h:151
ETL_CONSTEXPR14 void swap(pointer pbuffer1, pointer pbuffer2, size_t number_of_elements)
Swap bitset buffers.
Definition bitset_new.h:798
ETL_CONSTEXPR14 void or_equals(pointer pbuffer, const_pointer pbuffer2, size_t number_of_elements) ETL_NOEXCEPT
or_equals
Definition bitset_new.h:745
void swap(ibitset &other)
swap
Definition bitset_legacy.h:953
bitset< MaxN > & reset()
Reset all of the bits.
Definition bitset_legacy.h:1294
etl::enable_if< etl::is_integral< T >::value, T >::type value() const
Put to a value.
Definition bitset_legacy.h:1283
ETL_CONSTEXPR14 void and_equals(pointer pbuffer, const_pointer pbuffer2, size_t number_of_elements) ETL_NOEXCEPT
and_equals
Definition bitset_new.h:734
ETL_CONSTEXPR14 void set(pointer pbuffer, size_t number_of_elements, size_t total_bits, const wchar_t *text) ETL_NOEXCEPT
Set from a wstring.
Definition bitset_new.h:351
ETL_CONSTEXPR14 void set(pointer pbuffer, size_t number_of_elements, size_t total_bits, const char16_t *text) ETL_NOEXCEPT
Set from a u16string.
Definition bitset_new.h:359
size_t count() const
Count the number of bits set.
Definition bitset_legacy.h:265
ETL_CONSTEXPR14 void set(pointer pbuffer, size_t number_of_elements, size_t total_bits, const char32_t *text) ETL_NOEXCEPT
Set from a u32string.
Definition bitset_new.h:367
ETL_CONSTEXPR14 void xor_equals(pointer pbuffer, const_pointer pbuffer2, size_t number_of_elements) ETL_NOEXCEPT
xor_equals
Definition bitset_new.h:756
ETL_CONSTEXPR14 void set(pointer pbuffer, size_t number_of_elements, size_t position, bool value=true) ETL_NOEXCEPT
Set the bit at the position.
Definition bitset_new.h:190
ETL_CONSTEXPR14 etl::enable_if< etl::is_integral< T >::value, T >::type value(const_pointer pbuffer, size_t number_of_elements) const ETL_NOEXCEPT
Get as a value.
Definition bitset_new.h:378
ibitset & flip()
Flip all of the bits.
Definition bitset_legacy.h:555
ETL_CONSTEXPR14 void reset(pointer pbuffer, size_t number_of_elements, size_t position) ETL_NOEXCEPT
Reset the bit at the position.
Definition bitset_new.h:401
ETL_CONSTEXPR14 void set(pointer pbuffer, size_t number_of_elements, size_t total_bits, const char *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:343
bitset< MaxN > & operator<<=(size_t shift)
operator <<=
Definition bitset_legacy.h:1418
bitset< MaxN > operator<<(size_t shift) const
operator <<
Definition bitset_legacy.h:1406
bool operator[](size_t position) const
Read [] operator.
Definition bitset_legacy.h:729
ETL_CONSTEXPR14 void from_string(pointer pbuffer, size_t number_of_elements, size_t total_bits, const char32_t *text) ETL_NOEXCEPT
Set from a u32 string.
Definition bitset_new.h:313
bitset< MaxN > & operator|=(const bitset< MaxN > &other)
operator |=
Definition bitset_legacy.h:1376
ETL_CONSTEXPR14 void from_string(pointer pbuffer, size_t number_of_elements, size_t total_bits, const char16_t *text) ETL_NOEXCEPT
Set from a u16 string.
Definition bitset_new.h:283
bitset< MaxN > operator~() const
operator ~
Definition bitset_legacy.h:1394
ETL_CONSTEXPR14 void initialise(pointer pbuffer, size_t number_of_elements, unsigned long long value) ETL_NOEXCEPT
Initialise from an unsigned long long.
Definition bitset_new.h:767
bitset< MaxN > operator>>(size_t shift) const
operator >>
Definition bitset_legacy.h:1427
ETL_CONSTEXPR14 void shift_left_equals(pointer pbuffer, size_t number_of_elements, size_t shift) ETL_NOEXCEPT
shift_left_equals
Definition bitset_new.h:596
ETL_CONSTEXPR14 bool none(const_pointer pbuffer, size_t number_of_elements) const ETL_NOEXCEPT
Are none of the bits set?
Definition bitset_new.h:492
ibitset & from_string(const char *text)
Set from a string.
Definition bitset_legacy.h:362
bitset< MaxN > & operator=(const bitset< MaxN > &other)
operator =
Definition bitset_legacy.h:1354
bitset< MaxN > & operator^=(const bitset< MaxN > &other)
operator ^=
Definition bitset_legacy.h:1385
ETL_CONSTEXPR14 size_t find_first(const_pointer pbuffer, size_t number_of_elements, size_t total_bits, bool state) const ETL_NOEXCEPT
Definition bitset_new.h:510
bool none() const
Are none of the bits set?
Definition bitset_legacy.h:635
bool test(size_t position) const
Definition bitset_legacy.h:281
ETL_CONSTEXPR14 void from_string(pointer pbuffer, size_t number_of_elements, size_t total_bits, const char *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:223
ETL_CONSTEXPR14 void shift_right_equals(pointer pbuffer, size_t number_of_elements, size_t shift) ETL_NOEXCEPT
shift_right_equals
Definition bitset_new.h:665
bitset< MaxN > & set()
Set all of the bits.
Definition bitset_legacy.h:1179
bitset< MaxN > & operator>>=(size_t shift)
operator >>=
Definition bitset_legacy.h:1439
bitset< MaxN > & from_string(const char *text)
Set from a string.
Definition bitset_legacy.h:1241
Definition bitset_legacy.h:1102
Definition bitset_legacy.h:85
Definition bitset_new.h:136
Definition bitset_legacy.h:127
Definition bitset_new.h:107
Definition bitset_legacy.h:141
Definition exception.h:47
Definition integral_limits.h:468
is_integral
Definition type_traits_generator.h:1001
bitset_ext
Definition absolute.h:38
etl::byte & operator^=(etl::byte &lhs, etl::byte rhs)
Exclusive or equals.
Definition byte.h:305
etl::enable_if< etl::is_integral< TInteger >::value, etl::byte & >::type operator<<=(etl::byte &b, TInteger shift)
Shift left equals.
Definition byte.h:243
etl::byte operator|(etl::byte lhs, etl::byte rhs)
Or.
Definition byte.h:265
etl::byte & operator|=(etl::byte &lhs, etl::byte rhs)
Or equals.
Definition byte.h:289
etl::byte operator&(etl::byte lhs, etl::byte rhs)
And.
Definition byte.h:273
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:645
etl::enable_if<!etl::is_same< T, etl::istring >::value &&!etl::is_same< T, etl::string_view >::value, constetl::istring & >::type to_string(const T value, etl::istring &str, bool append=false)
Definition to_string.h:50
void swap(etl::array< T, SIZE > &lhs, etl::array< T, SIZE > &rhs)
Template deduction guides.
Definition array.h:621
etl::byte operator^(etl::byte lhs, etl::byte rhs)
Exclusive Or.
Definition byte.h:281
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:633
etl::enable_if< etl::is_integral< TInteger >::value, etl::byte & >::type operator>>=(etl::byte &b, TInteger shift)
Shift right equals.
Definition byte.h:255
etl::byte & operator&=(etl::byte &lhs, etl::byte rhs)
And equals.
Definition byte.h:297
ETL_CONSTEXPR size_t strlen(const T *t)
Alternative strlen for all character types.
Definition char_traits.h:267
Definition bitset_new.h:81
pair holds two objects of arbitrary type
Definition utility.h:164