30#ifndef ETL_BITSET_NEW_INCLUDED
31#define ETL_BITSET_NEW_INCLUDED
47#include "../static_assert.h"
60#if defined(ETL_COMPILER_KEIL)
61 #pragma diag_suppress 1300
66 #define ETL_STRL(x) L##x
67 #define ETL_STRu(x) u##x
68 #define ETL_STRU(x) U##x
99 ETL_ENUM_TYPE(Undefined,
"Undefined")
100 ETL_ENUM_TYPE(Single,
"Single")
101 ETL_ENUM_TYPE(Multi,
"Multi")
113 bitset_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
114 :
exception(reason_, file_name_, line_number_)
123 class bitset_string_too_small :
public bitset_exception
127 bitset_string_too_small(string_type file_name_, numeric_type line_number_)
128 : bitset_exception(ETL_ERROR_TEXT(
"bitset:type_too_small", ETL_BITSET_FILE_ID
"A"), file_name_, line_number_)
142 :
bitset_exception(ETL_ERROR_TEXT(
"bitset:overflow", ETL_BITSET_FILE_ID
"B"), file_name_, line_number_)
151 class bitset_invalid_buffer :
public bitset_exception
155 bitset_invalid_buffer(string_type file_name_, numeric_type line_number_)
156 : bitset_exception(ETL_ERROR_TEXT(
"bitset:invalid buffer", ETL_BITSET_FILE_ID
"C"), file_name_, line_number_)
162 namespace private_bitset
164 template <
typename TElement>
169 typedef TElement element_type;
170 typedef TElement* pointer;
171 typedef const TElement* const_pointer;
172 typedef size_t size_type;
177 static ETL_CONSTANT TElement All_Clear_Element = element_type(0);
180 template <
typename TElement>
181 ETL_CONSTANT
size_t bitset_impl_common<TElement>::npos;
183 template <
typename TElement>
184 ETL_CONSTANT
size_t bitset_impl_common<TElement>::Bits_Per_Element;
186 template <
typename TElement>
187 ETL_CONSTANT TElement bitset_impl_common<TElement>::All_Set_Element;
189 template <
typename TElement>
190 ETL_CONSTANT TElement bitset_impl_common<TElement>::All_Clear_Element;
197 template <
typename TElement,
char Bitset_Layout>
204 template <
typename TElement>
209 using typename etl::private_bitset::bitset_impl_common<TElement>::element_type;
210 using typename etl::private_bitset::bitset_impl_common<TElement>::pointer;
211 using typename etl::private_bitset::bitset_impl_common<TElement>::const_pointer;
222 static ETL_CONSTEXPR14
void set_all(pointer pbuffer,
size_t , element_type top_mask) ETL_NOEXCEPT
224 *pbuffer = All_Set_Element & top_mask;
232 const element_type mask = element_type(element_type(1) << position);
247 template <
size_t Position>
250 const element_type mask = element_type(element_type(1) << Position);
265 template <
size_t Position,
bool Value>
268 const element_type mask = element_type(element_type(1) << Position);
283 static ETL_CONSTEXPR14
void reset_all(pointer pbuffer,
size_t ) ETL_NOEXCEPT
285 *pbuffer = All_Clear_Element;
291 static ETL_CONSTEXPR14
296 const element_type mask = element_type(element_type(1) << position);
303 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t ,
size_t active_bits,
const char* text) ETL_NOEXCEPT
307 if (text != ETL_NULLPTR)
312 string_length = etl::min(active_bits, string_length);
314 if (string_length == 0U)
319 element_type mask = element_type(element_type(1) << (string_length - 1U));
321 for (
size_t i = 0U; i < string_length; ++i)
323 if (text[i] == ETL_STR(
'1'))
336 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t ,
size_t active_bits,
const wchar_t* text) ETL_NOEXCEPT
340 if (text != ETL_NULLPTR)
345 string_length = etl::min(active_bits, string_length);
347 if (string_length == 0U)
352 element_type mask = element_type(element_type(1) << (string_length - 1U));
354 for (
size_t i = 0U; i < string_length; ++i)
356 if (text[i] == ETL_STRL(
'1'))
369 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t ,
size_t active_bits,
const char16_t* text) ETL_NOEXCEPT
373 if (text != ETL_NULLPTR)
378 string_length = etl::min(active_bits, string_length);
380 if (string_length == 0U)
385 element_type mask = element_type(element_type(1) << (string_length - 1U));
387 for (
size_t i = 0U; i < string_length; ++i)
389 if (text[i] == ETL_STRu(
'1'))
402 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t ,
size_t active_bits,
const char32_t* text) ETL_NOEXCEPT
406 if (text != ETL_NULLPTR)
411 string_length = etl::min(active_bits, string_length);
413 if (string_length == 0U)
418 element_type mask = element_type(element_type(1) << (string_length - 1U));
420 for (
size_t i = 0U; i < string_length; ++i)
422 if (text[i] == ETL_STRU(
'1'))
435 template <
typename T>
436 static ETL_CONSTEXPR14 T
value(const_pointer pbuffer,
size_t ) ETL_NOEXCEPT
444 template <
typename T>
447 typedef typename etl::make_unsigned<T>::type unsigned_t;
449 const unsigned_t Mask = etl::make_lsb_mask<unsigned_t>(length);
450 const unsigned_t Shift = position % Bits_Per_Element;
452 unsigned_t
value =
static_cast<unsigned_t
>(*pbuffer >> Shift) & Mask;
459 return static_cast<T
>(
value);
466 template <typename T, size_t Position, size_t Length = etl::integral_limits<T>::bits>
468 template <
typename T,
size_t Position,
size_t Length>
470 static ETL_CONSTEXPR14 T
extract(const_pointer pbuffer)
472 typedef typename etl::make_unsigned<T>::type unsigned_t;
474 const unsigned_t Mask = etl::make_lsb_mask<unsigned_t>(Length);
475 const unsigned_t Shift = Position % Bits_Per_Element;
477 unsigned_t
value =
static_cast<unsigned_t
>(*pbuffer >> Shift) & Mask;
484 return static_cast<T
>(
value);
492 static ETL_CONSTEXPR14
bool test(const_pointer pbuffer,
size_t position)
494 const element_type mask = element_type(element_type(1) << position);
495 return (*pbuffer & mask) != 0U;
501 static ETL_CONSTEXPR14
size_t count(const_pointer pbuffer,
size_t ) ETL_NOEXCEPT
509 static ETL_CONSTEXPR14
bool all(const_pointer pbuffer,
size_t , element_type top_mask) ETL_NOEXCEPT
511 return (*pbuffer & top_mask) == top_mask;
517 static ETL_CONSTEXPR14
bool all(const_pointer pbuffer,
size_t , element_type top_mask, element_type mask) ETL_NOEXCEPT
519 return (*pbuffer & top_mask & mask) == mask;
525 static ETL_CONSTEXPR14
bool none(const_pointer pbuffer,
size_t ) ETL_NOEXCEPT
527 return *pbuffer == All_Clear_Element;
533 static ETL_CONSTEXPR14
bool none(const_pointer pbuffer,
size_t , element_type mask) ETL_NOEXCEPT
535 return (*pbuffer & mask) == All_Clear_Element;
541 static ETL_CONSTEXPR14
bool any(const_pointer pbuffer,
size_t ) ETL_NOEXCEPT
543 return *pbuffer != All_Clear_Element;
549 static ETL_CONSTEXPR14
bool any(const_pointer pbuffer,
size_t , element_type mask) ETL_NOEXCEPT
551 return (*pbuffer & mask) != All_Clear_Element;
557 static ETL_CONSTEXPR14
void flip_all(pointer pbuffer,
size_t ) ETL_NOEXCEPT
559 *pbuffer = ~*pbuffer;
575 const element_type mask = element_type(element_type(1) << position);
582 template <
typename TString>
583 static ETL_CONSTEXPR14 TString
to_string(const_pointer pbuffer,
size_t active_bits,
584 typename TString::value_type zero =
typename TString::value_type(
'0'),
585 typename TString::value_type one =
typename TString::value_type(
'1'))
589 result.resize(active_bits,
'\0');
594 for (
size_t i = active_bits; i > 0; --i)
596 result[active_bits - i] =
test(pbuffer, i - 1) ? one : zero;
608 static ETL_CONSTEXPR14
size_t find_next(const_pointer pbuffer,
size_t ,
size_t active_bits,
bool state,
size_t position)
611 if (position < active_bits)
614 size_t bit = position;
616 element_type mask = 1U << position;
619 if ((state && (*pbuffer != All_Clear_Element)) || (!state && (*pbuffer != All_Set_Element)))
622 while (
bit < active_bits)
625 if (((*pbuffer & mask) != 0) == state)
644 static ETL_CONSTEXPR14
void operator_assignment(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t ) ETL_NOEXCEPT
646 *lhs_pbuffer = *rhs_pbuffer;
653 static ETL_CONSTEXPR14
void operator_and(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t ) ETL_NOEXCEPT
655 *lhs_pbuffer &= *rhs_pbuffer;
662 static ETL_CONSTEXPR14
void operator_or(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t ) ETL_NOEXCEPT
664 *lhs_pbuffer |= *rhs_pbuffer;
671 static ETL_CONSTEXPR14
void operator_xor(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t ) ETL_NOEXCEPT
673 *lhs_pbuffer ^= *rhs_pbuffer;
680 static ETL_CONSTEXPR14
void operator_not(pointer pbuffer,
size_t ) ETL_NOEXCEPT
682 *pbuffer = ~*pbuffer;
688 static ETL_CONSTEXPR14
void operator_shift_left(pointer pbuffer,
size_t ,
size_t active_bits,
size_t shift) ETL_NOEXCEPT
690 if (shift >= active_bits)
703 static ETL_CONSTEXPR14
void operator_shift_right(pointer pbuffer,
size_t ,
size_t active_bits,
size_t shift) ETL_NOEXCEPT
705 if (shift >= active_bits)
718 static ETL_CONSTEXPR14
bool operator_equality(const_pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t ) ETL_NOEXCEPT
720 return (*lhs_pbuffer == *rhs_pbuffer);
726 template <
typename TElementType>
727 static ETL_CONSTEXPR14
void initialise(pointer pbuffer,
size_t ,
unsigned long long value) ETL_NOEXCEPT
729 *pbuffer =
static_cast<TElementType
>(
value);
735 static ETL_CONSTEXPR14
void swap(pointer lhs_pbuffer, pointer rhs_pbuffer,
size_t ) ETL_NOEXCEPT
737 element_type temp = *lhs_pbuffer;
738 *lhs_pbuffer = *rhs_pbuffer;
747 template <
typename TElement>
756 using typename etl::private_bitset::bitset_impl_common<TElement>::element_type;
757 using typename etl::private_bitset::bitset_impl_common<TElement>::pointer;
758 using typename etl::private_bitset::bitset_impl_common<TElement>::const_pointer;
769 template <
size_t Position,
size_t Length,
size_t Bits_Per_Element>
773 ETL_CONSTANT
bool value = ((Position + Length - 1) >> etl::log2<Bits_Per_Element>::value) == (Position >> etl::log2<Bits_Per_Element>::value);
781 static ETL_CONSTEXPR14
bool test(const_pointer pbuffer,
size_t position) ETL_NOEXCEPT
783 size_t index = position >> etl::log2<Bits_Per_Element>::value;
784 element_type mask = element_type(1) << (position & (Bits_Per_Element - 1));
786 return (pbuffer[index] & mask) != 0;
792 static ETL_CONSTEXPR14
size_t count(const_pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
796 while (number_of_elements-- != 0)
807 static ETL_CONSTEXPR14
bool all(const_pointer pbuffer,
size_t number_of_elements, element_type top_mask) ETL_NOEXCEPT
810 while (number_of_elements-- != 1U)
812 if (*pbuffer++ != All_Set_Element)
819 if ((*pbuffer & top_mask) != top_mask)
830 static ETL_CONSTEXPR14
bool none(const_pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
832 while (number_of_elements-- != 0)
846 static ETL_CONSTEXPR14
bool any(const_pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
848 bool any_set =
false;
850 while (number_of_elements-- != 0)
852 if (*pbuffer++ != All_Clear_Element)
865 static ETL_CONSTEXPR14
void set_all(pointer pbuffer,
size_t number_of_elements, element_type top_mask) ETL_NOEXCEPT
867 while (number_of_elements-- != 1U)
869 *pbuffer++ = All_Set_Element;
872 *pbuffer = (All_Set_Element & top_mask);
878 static ETL_CONSTEXPR14
void set_position(pointer pbuffer,
size_t position,
bool value =
true) ETL_NOEXCEPT
880 size_t index = position >> etl::log2<Bits_Per_Element>::value;
881 element_type
bit = element_type(1) << (position & (Bits_Per_Element - 1));
885 pbuffer[index] |=
bit;
889 pbuffer[index] &=
~bit;
896 template <
size_t Position>
899 size_t index = Position >> etl::log2<Bits_Per_Element>::value;
900 element_type
bit = element_type(1) << (Position & (Bits_Per_Element - 1));
904 pbuffer[index] |=
bit;
908 pbuffer[index] &=
~bit;
915 template <
size_t Position,
bool Value>
918 size_t index = Position >> etl::log2<Bits_Per_Element>::value;
919 element_type
bit = element_type(1) << (Position & (Bits_Per_Element - 1));
923 pbuffer[index] |=
bit;
927 pbuffer[index] &=
~bit;
934 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t number_of_elements,
size_t total_bits,
const char* text) ETL_NOEXCEPT
936 if (text == ETL_NULLPTR)
938 etl::fill_n(pbuffer, number_of_elements, All_Clear_Element);
943 size_t index = etl::min(number_of_elements - 1U, (string_length / Bits_Per_Element));
946 while (index != number_of_elements)
948 pbuffer[index++] = All_Clear_Element;
952 size_t i = etl::min(total_bits, string_length);
964 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t number_of_elements,
size_t total_bits,
const wchar_t* text) ETL_NOEXCEPT
966 if (text == ETL_NULLPTR)
968 etl::fill_n(pbuffer, number_of_elements, All_Clear_Element);
973 size_t index = etl::min(number_of_elements - 1U, (string_length / Bits_Per_Element));
976 while (index != number_of_elements)
978 pbuffer[index++] = All_Clear_Element;
982 size_t i = etl::min(total_bits, string_length);
994 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t number_of_elements,
size_t total_bits,
const char16_t* text) ETL_NOEXCEPT
996 if (text == ETL_NULLPTR)
998 etl::fill_n(pbuffer, number_of_elements, All_Clear_Element);
1003 size_t index = etl::min(number_of_elements - 1U, (string_length / Bits_Per_Element));
1006 while (index != number_of_elements)
1008 pbuffer[index++] = All_Clear_Element;
1012 size_t i = etl::min(total_bits, string_length);
1024 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t number_of_elements,
size_t total_bits,
const char32_t* text) ETL_NOEXCEPT
1026 if (text == ETL_NULLPTR)
1028 etl::fill_n(pbuffer, number_of_elements, All_Clear_Element);
1033 size_t index = etl::min(number_of_elements - 1U, (string_length / Bits_Per_Element));
1036 while (index != number_of_elements)
1038 pbuffer[index++] = All_Clear_Element;
1042 size_t i = etl::min(total_bits, string_length);
1054 static ETL_CONSTEXPR14
void reset_all(pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1056 while (number_of_elements-- != 0U)
1058 *pbuffer++ = All_Clear_Element;
1065 static ETL_CONSTEXPR14
void reset_position(pointer pbuffer,
size_t position) ETL_NOEXCEPT
1067 const size_t index = position >> etl::log2<Bits_Per_Element>::value;
1068 const element_type
bit = element_type(1) << (position & (Bits_Per_Element - 1));
1070 pbuffer[index] &=
~bit;
1076 template <
typename T>
1077 static ETL_CONSTEXPR14 T
value(const_pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1081 const bool OK = (
sizeof(T) * CHAR_BIT) >= (number_of_elements * Bits_Per_Element);
1085 uint_least8_t shift = 0U;
1087 for (
size_t i = 0UL; i < number_of_elements; ++i)
1089 v |= T(
typename etl::make_unsigned<T>::type(pbuffer[i]) << shift);
1090 shift += uint_least8_t(Bits_Per_Element);
1100 template <
typename T>
1102 size_t active_bits_in_msb,
size_t length) ETL_NOEXCEPT
1104 typedef typename etl::make_unsigned<T>::type unsigned_t;
1106 unsigned_t
value(0);
1109 if (active_bits_in_msb < Bits_Per_Element)
1111 element_type mask = etl::make_lsb_mask< element_type>(active_bits_in_msb);
1112 value = pbuffer[element_index] & mask;
1113 length -= active_bits_in_msb;
1114 if (length >= Bits_Per_Element)
1122 while (length >= Bits_Per_Element)
1124 value |= pbuffer[element_index];
1125 length -= Bits_Per_Element;
1126 if (length >= Bits_Per_Element)
1137 element_type mask = etl::make_lsb_mask< element_type>(length);
1138 value |= (pbuffer[element_index] >> (Bits_Per_Element - length)) & mask;
1148 template <
typename T>
1149 static ETL_CONSTEXPR14
typename etl::make_unsigned<T>::type
extract_from_buffer(const_pointer pbuffer,
size_t position,
size_t length)
1152 typedef typename etl::make_unsigned<T>::type unsigned_t;
1154 unsigned_t
value(0);
1156 const size_t Msb_Element_Index = (position + length - 1) >> etl::log2<Bits_Per_Element>::value;
1157 const size_t Lsb_Element_Index = position >> etl::log2<Bits_Per_Element>::value;
1160 if (Msb_Element_Index == Lsb_Element_Index)
1162 const unsigned_t Mask = etl::make_lsb_mask< unsigned_t>(length);
1163 const unsigned_t Shift = position % Bits_Per_Element;
1165 value =
static_cast<unsigned_t
>(pbuffer[Msb_Element_Index] >> Shift) & Mask;
1170 size_t active_bits_in_msb = (position + length) - (
static_cast<size_t>(Msb_Element_Index) * Bits_Per_Element);
1173 size_t element_index = Msb_Element_Index;
1185 template <
typename T,
size_t Position,
size_t Length>
1186 static ETL_CONSTEXPR14
1187 typename etl::enable_if< value_is_in_one_element<Position, Length, Bits_Per_Element>::value,
typename etl::make_unsigned<T>::type>
::type
1190 typedef typename etl::make_unsigned<T>::type unsigned_t;
1192 const size_t Element_Index = (Position + Length - 1) >> etl::log2<Bits_Per_Element>::value;
1193 const unsigned_t Mask = etl::lsb_mask<unsigned_t, Length>::value;
1194 const unsigned_t Shift = Position % Bits_Per_Element;
1196 return static_cast<unsigned_t
>(pbuffer[Element_Index] >> Shift) & Mask;
1203 template <
typename T,
size_t Position,
size_t Length>
1204 static ETL_CONSTEXPR14
1205 typename etl::enable_if< !value_is_in_one_element<Position, Length, Bits_Per_Element>::value,
typename etl::make_unsigned<T>::type>
::type
1209 const size_t Msb_Element_Index = (Position + Length - 1) >> etl::log2<Bits_Per_Element>::value;
1212 const size_t Active_Bits_In_Msb = ((Position + Length - 1) % Bits_Per_Element) + 1;
1220 template <
typename T>
1223 typedef typename etl::make_unsigned<T>::type unsigned_t;
1232 return static_cast<T
>(
value);
1238 template <
typename T,
size_t Position,
size_t Length>
1239 static ETL_CONSTEXPR14 T
extract(const_pointer pbuffer)
1241 typedef typename etl::make_unsigned<T>::type unsigned_t;
1250 return static_cast<T
>(
value);
1256 static ETL_CONSTEXPR14
void flip_all(pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1264 static ETL_CONSTEXPR14
void flip_position(pointer pbuffer,
size_t position) ETL_NOEXCEPT
1266 const size_t index = position >> etl::log2<Bits_Per_Element>::value;
1267 const element_type
bit = element_type(1) << (position & (Bits_Per_Element - 1));
1269 pbuffer[index] ^=
bit;
1278 static ETL_CONSTEXPR14
size_t find_next(const_pointer pbuffer,
size_t number_of_elements,
size_t total_bits,
bool state,
size_t position)
1282 size_t index = position >> log2<Bits_Per_Element>::value;
1283 size_t bit = position & (Bits_Per_Element - 1);
1285 element_type mask = 1 <<
bit;
1288 while (index < number_of_elements)
1290 element_type
value = pbuffer[index];
1293 if ((state && (
value != All_Clear_Element)) || (!state && (
value != All_Set_Element)))
1296 while ((
bit < Bits_Per_Element) && (position < total_bits))
1299 if (((
value & mask) != 0) == state)
1312 position += (Bits_Per_Element -
bit);
1328 template <
typename TString>
1329 static ETL_CONSTEXPR14 TString
to_string(const_pointer pbuffer,
size_t active_bits,
typename TString::value_type zero,
typename TString::value_type one)
1333 result.resize(active_bits,
'\0');
1338 for (
size_t i = active_bits; i > 0; --i)
1340 result[active_bits - i] =
test(pbuffer, i - 1) ? one : zero;
1349 static ETL_CONSTEXPR14
void operator_assignment(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1351 while (number_of_elements-- != 0)
1353 *lhs_pbuffer = *rhs_pbuffer;
1362 static ETL_CONSTEXPR14
void operator_and(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1364 while (number_of_elements-- != 0)
1366 *lhs_pbuffer &= *rhs_pbuffer;
1375 static ETL_CONSTEXPR14
void operator_or(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1377 while (number_of_elements-- != 0)
1379 *lhs_pbuffer |= *rhs_pbuffer;
1388 static ETL_CONSTEXPR14
void operator_xor(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1390 while (number_of_elements-- != 0)
1392 *lhs_pbuffer ^= *rhs_pbuffer;
1401 static ETL_CONSTEXPR14
void operator_not(pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1403 while (number_of_elements-- != 0)
1405 *pbuffer = ~*pbuffer;
1413 static ETL_CONSTEXPR14
void operator_shift_left(pointer pbuffer,
size_t number_of_elements,
size_t active_bits,
size_t shift) ETL_NOEXCEPT
1415 if (shift >= active_bits)
1422 const size_t split_position = Bits_Per_Element - (shift % Bits_Per_Element);
1425 int src_index = int(number_of_elements - (shift / Bits_Per_Element) - 1U);
1428 int dst_index = int(number_of_elements - 1U);
1431 const size_t lsb_shift = Bits_Per_Element - split_position;
1432 const size_t msb_shift = split_position;
1436 const element_type lsb_shifted_mask = element_type(
lsb_mask << lsb_shift);
1439 element_type lsb = element_type((pbuffer[src_index] &
lsb_mask) << lsb_shift);
1440 pbuffer[dst_index] = lsb;
1444 while (src_index >= 0)
1447 element_type msb = element_type((pbuffer[src_index] &
msb_mask) >> msb_shift);
1448 pbuffer[dst_index] = pbuffer[dst_index] | msb;
1452 lsb = element_type((pbuffer[src_index] &
lsb_mask) << lsb_shift);
1453 pbuffer[dst_index] = lsb;
1459 pbuffer[dst_index] &= lsb_shifted_mask;
1462 for (
int i = 0; i < dst_index; ++i)
1472 static ETL_CONSTEXPR14
void operator_shift_right(pointer pbuffer,
size_t number_of_elements,
size_t active_bits,
size_t shift) ETL_NOEXCEPT
1474 if (shift >= active_bits)
1481 const size_t split_position = shift % Bits_Per_Element;
1484 int src_index = int(shift / Bits_Per_Element);
1490 const size_t lsb_shift = Bits_Per_Element - split_position;
1491 const size_t msb_shift = split_position;
1495 const element_type msb_shifted_mask = element_type(
msb_mask >> msb_shift);
1498 while (src_index <
int(number_of_elements - 1))
1501 element_type msb = element_type((pbuffer[src_index] &
msb_mask) >> msb_shift);
1505 element_type lsb = element_type((pbuffer[src_index] &
lsb_mask) << lsb_shift);
1508 pbuffer[dst_index] = lsb | msb;
1513 element_type msb = element_type((pbuffer[src_index] &
msb_mask) >> msb_shift);
1514 pbuffer[dst_index] = msb;
1518 pbuffer[dst_index] &= msb_shifted_mask;
1522 while (dst_index <
int(number_of_elements))
1524 pbuffer[dst_index] = 0;
1533 static ETL_CONSTEXPR14
bool operator_equality(const_pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1535 return etl::equal(lhs_pbuffer, lhs_pbuffer + number_of_elements, rhs_pbuffer);
1543 template <
typename TElementType>
1546 initialise(pointer pbuffer,
size_t number_of_elements,
unsigned long long value) ETL_NOEXCEPT
1551 pbuffer[i++] =
value;
1554 while (i != number_of_elements)
1556 pbuffer[i++] = All_Clear_Element;
1565 template <
typename TElementType>
1568 initialise(pointer pbuffer,
size_t number_of_elements,
unsigned long long value) ETL_NOEXCEPT
1575 while ((
value != 0) && (i != number_of_elements))
1577 pbuffer[i++] =
value & All_Set_Element;
1582 while (i != number_of_elements)
1584 pbuffer[i++] = All_Clear_Element;
1591 static ETL_CONSTEXPR14
void swap(pointer pbuffer1, pointer pbuffer2,
size_t number_of_elements)
1593 etl::swap_ranges(pbuffer1, pbuffer1 + number_of_elements, pbuffer2);
1597 namespace private_bitset
1600 template <
size_t Active_Bits,
typename TElement>
1605 typedef typename etl::private_bitset::bitset_impl_common<TElement>::element_type element_type;
1611 static ETL_CONSTANT
size_t Number_Of_Elements =
1612 (Active_Bits % Bits_Per_Element == 0) ? Active_Bits / Bits_Per_Element : Active_Bits / Bits_Per_Element + 1;
1613 static ETL_CONSTANT
size_t Size = Active_Bits;
1614 static ETL_CONSTANT
size_t Allocated_Bits = Number_Of_Elements * Bits_Per_Element;
1618 (bitset_common<Active_Bits, TElement>::Number_Of_Elements == 1U) ? etl::bitset_storage_model::Single : etl::bitset_storage_model::Multi;
1628 static ETL_CONSTANT
size_t Top_Mask_Shift = ((Bits_Per_Element - ((Number_Of_Elements * Bits_Per_Element) - Active_Bits)) % Bits_Per_Element);
1632 static ETL_CONSTANT TElement Top_Mask = element_type(Top_Mask_Shift == 0 ? All_Set_Element : ~(All_Set_Element << Top_Mask_Shift));
1635 template <
size_t Active_Bits,
typename TElement>
1636 ETL_CONSTANT
size_t bitset_common<Active_Bits, TElement>::Number_Of_Elements;
1638 template <
size_t Active_Bits,
typename TElement>
1639 ETL_CONSTANT
size_t bitset_common<Active_Bits, TElement>::Size;
1642 template <
size_t Active_Bits,
typename TElement>
1645 template <
size_t Active_Bits,
typename TElement>
1647 (bitset_common<Active_Bits, TElement>::Number_Of_Elements == 1U) ? etl::bitset_storage_model::Single :
etl::
bitset_storage_model::Multi;
1650 template <
size_t Active_Bits,
typename TElement>
1651 ETL_CONSTANT
size_t bitset_common<Active_Bits, TElement>::Top_Mask_Shift;
1653 template <
size_t Active_Bits,
typename TElement>
1654 ETL_CONSTANT TElement bitset_common<Active_Bits, TElement>::Top_Mask;
1660 template <
size_t Active_Bits = 0U,
typename TElement =
unsigned char>
1671 typedef etl::private_bitset::bitset_common<0U, unsigned char>::element_type element_type;
1672 typedef etl::private_bitset::bitset_common<0U, unsigned char>::span_type span_type;
1673 typedef etl::private_bitset::bitset_common< 0U, unsigned char>::const_span_type const_span_type;
1688 template <
size_t Active_Bits,
typename TElement>
1693 ETL_STATIC_ASSERT(etl::is_unsigned<TElement>::value,
"The element type must be unsigned");
1695 typedef typename etl::private_bitset::bitset_common< Active_Bits, TElement>::element_type element_type;
1696 typedef typename etl::private_bitset::bitset_common< Active_Bits, TElement>::span_type span_type;
1697 typedef typename etl::private_bitset::bitset_common< Active_Bits, TElement>::const_span_type const_span_type;
1715 friend class bitset;
1721 : p_bitset(other.p_bitset)
1722 , position(other.position)
1729 ETL_CONSTEXPR14
operator bool() const ETL_NOEXCEPT
1731 return p_bitset->test(position);
1739 p_bitset->set(position, b);
1748 p_bitset->set(position,
bool(r));
1757 p_bitset->
flip(position);
1766 return !p_bitset->test(position);
1775 : p_bitset(ETL_NULLPTR)
1784 : p_bitset(&r_bitset)
1785 , position(position_)
1789 bitset<Active_Bits, TElement>* p_bitset;
1799 implementation::reset_all(buffer, Number_Of_Elements);
1808 implementation::operator_assignment(buffer, other.buffer, Number_Of_Elements);
1814 template <
typename TValue>
1815 ETL_CONSTEXPR14
bitset(TValue
value,
typename etl::enable_if<is_integral<TValue>::value>
::type* = 0) ETL_NOEXCEPT
1824 template <
typename TPString>
1825 ETL_CONSTEXPR14
bitset(TPString text,
typename etl::enable_if<is_same<TPString, const char*>::value>
::type* = 0) ETL_NOEXCEPT
1828 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1834 template <
typename TPString>
1835 ETL_CONSTEXPR14
bitset(TPString text,
typename etl::enable_if<is_same<TPString, const wchar_t*>::value>
::type* = 0) ETL_NOEXCEPT
1838 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1844 template <
typename TPString>
1845 ETL_CONSTEXPR14
bitset(TPString text,
typename etl::enable_if< is_same<TPString, const char16_t*>::value>
::type* = 0) ETL_NOEXCEPT
1848 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1854 template <
typename TPString>
1855 ETL_CONSTEXPR14
bitset(TPString text,
typename etl::enable_if< is_same<TPString, const char32_t*>::value>
::type* = 0) ETL_NOEXCEPT
1858 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1866 implementation::operator_assignment(buffer, other.buffer, Number_Of_Elements);
1876 implementation::set_all(buffer, Number_Of_Elements, Top_Mask);
1886 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
1888 implementation::set_position(buffer, position,
value);
1896 template <
size_t Position>
1899 ETL_STATIC_ASSERT(Position < Active_Bits,
"Position out of bounds");
1901 implementation::template set_position<Position>(buffer,
value);
1909 template <
size_t Position,
bool Value>
1912 ETL_STATIC_ASSERT(Position < Active_Bits,
"Position out of bounds");
1914 implementation::template set_position<Position, Value>(buffer);
1922 template <
typename TPString>
1926 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1934 template <
typename TPString>
1938 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1946 template <
typename TPString>
1950 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1958 template <
typename TPString>
1962 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1972 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1982 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1992 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
2002 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
2010 template <
typename T>
2011 ETL_CONSTEXPR14
typename etl::enable_if<etl::is_integral<T>::value, T>
::type value() const ETL_NOEXCEPT
2013 ETL_STATIC_ASSERT(etl::is_integral<T>::value,
"Only integral types are supported");
2016 return implementation::template
value<T>(buffer, Number_Of_Elements);
2023 template <
typename T>
2026 ETL_STATIC_ASSERT(etl::is_integral<T>::value,
"Only integral types are supported");
2029 ETL_ASSERT_OR_RETURN_VALUE((position + length) <= Active_Bits, ETL_ERROR(
bitset_overflow), 0);
2031 return implementation::template
extract<T>(buffer, position, length);
2039 template <typename T, size_t Position, size_t Length = etl::integral_limits<T>::bits>
2041 template <
typename T,
size_t Position,
size_t Length>
2045 ETL_STATIC_ASSERT(etl::is_integral<T>::value,
"Only integral types are supported");
2047 ETL_STATIC_ASSERT((Position + Length) <= Active_Bits,
"Position/Length overflows bitset");
2077 implementation::reset_all(buffer, Number_Of_Elements);
2087 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
2089 implementation::reset_position(buffer, position);
2099 ETL_CONSTEXPR14
bool test(
size_t position)
const
2101 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow),
false);
2103 return implementation::test(buffer, position);
2110 template <
size_t Position>
2113 ETL_STATIC_ASSERT(Position < Active_Bits,
"Position out of bounds");
2115 return implementation::test(buffer, Position);
2121 static ETL_CONSTEXPR
size_t size() ETL_NOEXCEPT
2131 return Number_Of_Elements;
2139 return All_Set_Element;
2147 return All_Clear_Element;
2155 return Bits_Per_Element;
2161 static ETL_CONSTEXPR element_type
top_mask() ETL_NOEXCEPT
2171 return Number_Of_Elements * Bits_Per_Element;
2181 return Storage_Model;
2187 ETL_CONSTEXPR14
size_t count() const ETL_NOEXCEPT
2189 return implementation::count(buffer, Number_Of_Elements);
2195 ETL_CONSTEXPR14
bool all() const ETL_NOEXCEPT
2197 return implementation::all(buffer, Number_Of_Elements, Top_Mask);
2203 ETL_CONSTEXPR14
bool all(element_type mask)
const ETL_NOEXCEPT
2205 ETL_STATIC_ASSERT(Storage_Model == etl::bitset_storage_model::Single,
"Not supported for 'Multi' bitset storage model");
2207 return implementation::all(buffer, Number_Of_Elements, Top_Mask, mask);
2213 ETL_CONSTEXPR14
bool none() const ETL_NOEXCEPT
2215 return implementation::none(buffer, Number_Of_Elements);
2221 ETL_CONSTEXPR14
bool none(element_type mask)
const ETL_NOEXCEPT
2223 ETL_STATIC_ASSERT(Storage_Model == etl::bitset_storage_model::Single,
"Not supported for 'Multi' bitset storage model");
2225 return implementation::none(buffer, Number_Of_Elements, mask);
2231 ETL_CONSTEXPR14
bool any() const ETL_NOEXCEPT
2233 return implementation::any(buffer, Number_Of_Elements);
2239 ETL_CONSTEXPR14
bool any(element_type mask)
const ETL_NOEXCEPT
2241 ETL_STATIC_ASSERT(Storage_Model == etl::bitset_storage_model::Single,
"Not supported for 'Multi' bitset storage model");
2243 return implementation::any(buffer, Number_Of_Elements, mask);
2251 implementation::flip_all(buffer, Number_Of_Elements);
2261 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
2263 implementation::flip_position(buffer, position);
2271 ETL_CONSTEXPR14
bool operator[](
size_t position)
const ETL_NOEXCEPT
2273 return implementation::test(buffer, position);
2288 template <
typename TString = etl::
string<Active_Bits>>
2290 template <
typename TString>
2292 ETL_CONSTEXPR14 TString
to_string(
typename TString::value_type zero =
typename TString::value_type(
'0'),
2293 typename TString::value_type one =
typename TString::value_type(
'1'))
const
2305 return implementation::find_next(buffer, Number_Of_Elements, Active_Bits, state, 0);
2314 ETL_CONSTEXPR14
size_t find_next(
bool state,
size_t position)
const ETL_NOEXCEPT
2316 return implementation::find_next(buffer, Number_Of_Elements, Active_Bits, state, position);
2326 implementation::operator_and(temp.buffer, other.buffer, Number_Of_Elements);
2336 implementation::operator_and(buffer, other.buffer, Number_Of_Elements);
2348 implementation::operator_or(temp.buffer, other.buffer, Number_Of_Elements);
2358 implementation::operator_or(&buffer[0], &other.buffer[0], Number_Of_Elements);
2370 implementation::operator_xor(temp.buffer, other.buffer, Number_Of_Elements);
2380 implementation::operator_xor(buffer, other.buffer, Number_Of_Elements);
2392 implementation::flip_all(temp.buffer, Number_Of_Elements);
2404 implementation::operator_shift_left(temp.buffer, Number_Of_Elements, Active_Bits, shift);
2414 if (shift >= Active_Bits)
2416 implementation::reset_all(buffer, Number_Of_Elements);
2420 implementation::operator_shift_left(buffer, Number_Of_Elements, Active_Bits, shift);
2433 implementation::operator_shift_right(temp.buffer, Number_Of_Elements, Active_Bits, shift);
2443 if (shift >= Active_Bits)
2445 implementation::reset_all(buffer, Number_Of_Elements);
2449 implementation::operator_shift_right(buffer, Number_Of_Elements, Active_Bits, shift);
2460 return implementation::operator_equality(lhs.buffer, rhs.buffer, lhs.Number_Of_Elements);
2468 return !(lhs == rhs);
2476 implementation::swap(buffer, other.buffer, Number_Of_Elements);
2483 ETL_CONSTEXPR14 span_type
span() ETL_NOEXCEPT
2485 return span_type(buffer, Number_Of_Elements);
2492 ETL_CONSTEXPR14 const_span_type
span() const ETL_NOEXCEPT
2494 return const_span_type(buffer, Number_Of_Elements);
2504 element_type buffer[Number_Of_Elements];
2511 template <
size_t Active_Bits,
typename TElement>
2523 template <
size_t Active_Bits,
typename TElement>
2535 template <
size_t Active_Bits,
typename TElement>
2547 template <
size_t Active_Bits,
typename TElement>
2550 return !(lhs == rhs);
2556 template <
size_t Active_Bits,
typename TElement>
2567 template <
size_t Active_Bits = 0U,
typename TElement =
unsigned char>
2578 typedef size_t size_type;
2580 typedef etl::private_bitset::bitset_common<0U, unsigned char>::element_type element_type;
2581 typedef etl::private_bitset::bitset_common<0U, unsigned char>::span_type span_type;
2582 typedef etl::private_bitset::bitset_common< 0U, unsigned char>::const_span_type const_span_type;
2597 template <
size_t Active_Bits,
typename TElement>
2602 ETL_STATIC_ASSERT(etl::is_unsigned<TElement>::value,
"The element type must be unsigned");
2604 typedef size_t size_type;
2606 typedef typename etl::private_bitset::bitset_common< Active_Bits, TElement>::element_type element_type;
2607 typedef typename etl::private_bitset::bitset_common< Active_Bits, TElement>::span_type span_type;
2608 typedef typename etl::private_bitset::bitset_common< Active_Bits, TElement>::const_span_type const_span_type;
2628 friend class bitset_ext;
2634 : p_bitset(other.p_bitset)
2635 , position(other.position)
2642 ETL_CONSTEXPR14
operator bool() const ETL_NOEXCEPT
2644 return p_bitset->test(position);
2652 p_bitset->set(position, b);
2661 p_bitset->set(position,
bool(r));
2670 p_bitset->
flip(position);
2679 return !p_bitset->test(position);
2688 : p_bitset(ETL_NULLPTR)
2697 : p_bitset(&r_bitset)
2698 , position(position_)
2702 bitset_ext<Active_Bits, TElement>* p_bitset;
2713 implementation::reset_all(pbuffer, Number_Of_Elements);
2720 : pbuffer(buffer.
data())
2723 implementation::reset_all(pbuffer, Number_Of_Elements);
2733 implementation::operator_assignment(pbuffer, other.pbuffer, Number_Of_Elements);
2740 : pbuffer(buffer.data())
2742 implementation::operator_assignment(pbuffer, other.pbuffer, Number_Of_Elements);
2757 implementation::template initialise<element_type>(pbuffer, Number_Of_Elements,
value);
2763 template <
typename TValue>
2764 ETL_CONSTEXPR14
bitset_ext(TValue
value, buffer_type& buffer,
typename etl::enable_if<is_integral<TValue>::value>
::type* = 0) ETL_NOEXCEPT
2765 : pbuffer(buffer.
data())
2767 implementation::template initialise<element_type>(pbuffer, Number_Of_Elements,
static_cast<unsigned long long>(
value));
2773 template <
typename TPString>
2774 ETL_CONSTEXPR14
bitset_ext(TPString text, element_type* pbuffer_,
typename etl::enable_if<is_same<TPString, const char*>::value>
::type* = 0)
2778 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2784 template <
typename TPString>
2785 ETL_CONSTEXPR14
bitset_ext(TPString text, buffer_type& buffer,
typename etl::enable_if<is_same<TPString, const char*>::value>
::type* = 0)
2787 : pbuffer(buffer.
data())
2789 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2795 template <
typename TPString>
2796 ETL_CONSTEXPR14
bitset_ext(TPString text, element_type* pbuffer_,
typename etl::enable_if<is_same<TPString, const wchar_t*>::value>
::type* = 0)
2800 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2806 template <
typename TPString>
2807 ETL_CONSTEXPR14
bitset_ext(TPString text, buffer_type& buffer,
typename etl::enable_if<is_same<TPString, const wchar_t*>::value>
::type* = 0)
2809 : pbuffer(buffer.
data())
2811 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2817 template <
typename TPString>
2818 ETL_CONSTEXPR14
bitset_ext(TPString text, element_type* pbuffer_,
typename etl::enable_if< is_same<TPString, const char16_t*>::value>
::type* = 0)
2822 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2828 template <
typename TPString>
2829 ETL_CONSTEXPR14
bitset_ext(TPString text, buffer_type& buffer,
typename etl::enable_if< is_same<TPString, const char16_t*>::value>
::type* = 0)
2831 : pbuffer(buffer.
data())
2833 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2839 template <
typename TPString>
2840 ETL_CONSTEXPR14
bitset_ext(TPString text, element_type* pbuffer_,
typename etl::enable_if< is_same<TPString, const char32_t*>::value>
::type* = 0)
2844 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2850 template <
typename TPString>
2851 ETL_CONSTEXPR14
bitset_ext(TPString text, buffer_type& buffer,
typename etl::enable_if< is_same<TPString, const char32_t*>::value>
::type* = 0)
2853 : pbuffer(buffer.
data())
2855 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2863 implementation::operator_assignment(pbuffer, other.pbuffer, Number_Of_Elements);
2873 implementation::set_all(pbuffer, Number_Of_Elements, Top_Mask);
2883 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
2885 implementation::set_position(pbuffer, position,
value);
2893 template <
size_t Position>
2896 ETL_STATIC_ASSERT(Position < Active_Bits,
"Position out of bounds");
2898 implementation::template set_position<Position>(pbuffer,
value);
2906 template <
size_t Position,
bool Value>
2909 ETL_STATIC_ASSERT(Position < Active_Bits,
"Position out of bounds");
2911 implementation::template set_position<Position, Value>(pbuffer);
2919 template <
typename TPString>
2923 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2931 template <
typename TPString>
2933 set(TPString text) ETL_NOEXCEPT
2935 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2943 template <
typename TPString>
2945 set(TPString text) ETL_NOEXCEPT
2947 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2955 template <
typename TPString>
2957 set(TPString text) ETL_NOEXCEPT
2959 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2969 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2979 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2989 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2999 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
3007 template <
typename T>
3008 ETL_CONSTEXPR14 T
value() const ETL_NOEXCEPT
3010 ETL_STATIC_ASSERT(etl::is_integral<T>::value,
"Only integral types are supported");
3013 return implementation::template
value<T>(pbuffer, Number_Of_Elements);
3020 template <
typename T>
3023 ETL_STATIC_ASSERT(etl::is_integral<T>::value,
"Only integral types are supported");
3026 ETL_ASSERT_OR_RETURN_VALUE((position + length) <= Active_Bits, ETL_ERROR(
bitset_overflow), 0);
3028 return implementation::template
extract<T>(pbuffer, position, length);
3036 template <typename T, size_t Position, size_t Length = etl::integral_limits<T>::bits>
3038 template <
typename T,
size_t Position,
size_t Length>
3042 ETL_STATIC_ASSERT(etl::is_integral<T>::value,
"Only integral types are supported");
3044 ETL_STATIC_ASSERT((Position + Length) <= Active_Bits,
"Position/Length overflows bitset");
3074 implementation::reset_all(pbuffer, Number_Of_Elements);
3084 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
3086 implementation::reset_position(pbuffer, position);
3096 ETL_CONSTEXPR14
bool test(
size_t position)
const
3098 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow),
false);
3100 return implementation::test(pbuffer, position);
3107 template <
size_t Position>
3110 ETL_STATIC_ASSERT(Position < Active_Bits,
"Position out of bounds");
3112 return implementation::test(pbuffer, Position);
3118 static ETL_CONSTEXPR
size_t size() ETL_NOEXCEPT
3128 return Number_Of_Elements;
3136 return All_Set_Element;
3144 return All_Clear_Element;
3150 static ETL_CONSTEXPR element_type
top_mask() ETL_NOEXCEPT
3160 return Bits_Per_Element;
3168 return Number_Of_Elements * Bits_Per_Element;
3178 return Storage_Model;
3184 ETL_CONSTEXPR14
size_t count() const ETL_NOEXCEPT
3186 return implementation::count(pbuffer, Number_Of_Elements);
3192 ETL_CONSTEXPR14
bool all() const ETL_NOEXCEPT
3194 return implementation::all(pbuffer, Number_Of_Elements, Top_Mask);
3200 ETL_CONSTEXPR14
bool all(element_type mask)
const ETL_NOEXCEPT
3202 ETL_STATIC_ASSERT(Storage_Model == etl::bitset_storage_model::Single,
"Not supported for 'Multi' bitset storage model");
3204 return implementation::all(pbuffer, Number_Of_Elements, Top_Mask, mask);
3210 ETL_CONSTEXPR14
bool none() const ETL_NOEXCEPT
3212 return implementation::none(pbuffer, Number_Of_Elements);
3218 ETL_CONSTEXPR14
bool none(element_type mask)
const ETL_NOEXCEPT
3220 ETL_STATIC_ASSERT(Storage_Model == etl::bitset_storage_model::Single,
"Not supported for 'Multi' bitset storage model");
3222 return implementation::none(pbuffer, Number_Of_Elements, mask);
3228 ETL_CONSTEXPR14
bool any() const ETL_NOEXCEPT
3230 return implementation::any(pbuffer, Number_Of_Elements);
3236 ETL_CONSTEXPR14
bool any(element_type mask)
const ETL_NOEXCEPT
3238 ETL_STATIC_ASSERT(Storage_Model == etl::bitset_storage_model::Single,
"Not supported for 'Multi' bitset storage model");
3240 return implementation::any(pbuffer, Number_Of_Elements, mask);
3248 implementation::flip_all(pbuffer, Number_Of_Elements);
3258 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
3260 implementation::flip_position(pbuffer, position);
3268 ETL_CONSTEXPR14
bool operator[](
size_t position)
const ETL_NOEXCEPT
3270 return implementation::test(pbuffer, position);
3285 template <
typename TString = etl::
string<Active_Bits>>
3287 template <
typename TString>
3289 ETL_CONSTEXPR14 TString
to_string(
typename TString::value_type zero =
typename TString::value_type(
'0'),
3290 typename TString::value_type one =
typename TString::value_type(
'1'))
const
3302 return implementation::find_next(pbuffer, Number_Of_Elements, Active_Bits, state, 0);
3311 ETL_CONSTEXPR14
size_t find_next(
bool state,
size_t position)
const ETL_NOEXCEPT
3313 return implementation::find_next(pbuffer, Number_Of_Elements, Active_Bits, state, position);
3321 implementation::operator_and(&pbuffer[0], &other.pbuffer[0], Number_Of_Elements);
3331 implementation::operator_or(&pbuffer[0], &other.pbuffer[0], Number_Of_Elements);
3341 implementation::operator_xor(&pbuffer[0], &other.pbuffer[0], Number_Of_Elements);
3351 implementation::operator_shift_left(pbuffer, Number_Of_Elements, Active_Bits, shift);
3361 implementation::operator_shift_right(pbuffer, Number_Of_Elements, Active_Bits, shift);
3371 return implementation::operator_equality(lhs.pbuffer, rhs.pbuffer, lhs.Number_Of_Elements);
3379 return !(lhs == rhs);
3387 implementation::swap(pbuffer, other.pbuffer, Number_Of_Elements);
3394 ETL_CONSTEXPR14 span_type
span() ETL_NOEXCEPT
3396 return span_type(pbuffer, Number_Of_Elements);
3403 ETL_CONSTEXPR14 const_span_type
span() const ETL_NOEXCEPT
3405 return const_span_type(pbuffer, Number_Of_Elements);
3415 element_type* pbuffer;
3422 template <
size_t Active_Bits,
typename TElement>
3425 return !(lhs == rhs);
3431 template <
size_t Active_Bits,
typename TElement>
3437 namespace private_bitset
3443 template <
typename TLhsSpan,
typename TRhsSpan>
3446 typedef typename TLhsSpan::value_type lhs_element_t;
3447 typedef typename TRhsSpan::value_type rhs_element_t;
3449 const int steps =
static_cast<int>(
sizeof(lhs_element_t) /
sizeof(rhs_element_t));
3451 typename TLhsSpan::iterator lhs_itr = lhs_span.begin();
3452 typename TRhsSpan::iterator rhs_itr = rhs_span.begin();
3454 while (lhs_itr != lhs_span.end())
3456 const lhs_element_t& lhs_value = *lhs_itr;
3459 lhs_element_t rhs_value = 0;
3464 for (
int i = 0; i < steps; ++i)
3466 rhs_value |= (
static_cast<lhs_element_t
>(*rhs_itr) << shift);
3468 shift += shift_step;
3471 if (lhs_value != rhs_value)
3489 template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3490 ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3494 typename etl::bitset<Active_Bits, TLhsElement>::const_span_type lhs_span = lhs.span();
3495 typename etl::bitset<Active_Bits, TRhsElement>::const_span_type rhs_span = rhs.span();
3498 if ETL_IF_CONSTEXPR (
sizeof(TLhsElement) >
sizeof(TRhsElement))
3514 template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3515 ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3518 return !(lhs == rhs);
3527 template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3528 ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3532 typename etl::bitset_ext<Active_Bits, TLhsElement>::const_span_type lhs_span = lhs.span();
3533 typename etl::bitset_ext<Active_Bits, TRhsElement>::const_span_type rhs_span = rhs.span();
3536 if ETL_IF_CONSTEXPR (
sizeof(TLhsElement) >
sizeof(TRhsElement))
3552 template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3553 ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3556 return !(lhs == rhs);
3564 template <
size_t Active_Bits,
typename TElement>
3567 const char Storage_Model = etl::bitset<Active_Bits, TElement>::Storage_Model;
3568 const size_t Number_Of_Elements = etl::bitset<Active_Bits, TElement>::Number_Of_Elements;
3570 typename etl::bitset<Active_Bits, TElement>::const_span_type lhs_span = lhs.span();
3571 typename etl::bitset_ext<Active_Bits, TElement>::const_span_type rhs_span = rhs.span();
3575 return implementation::operator_equality(lhs_span.
begin(), rhs_span.
begin(), Number_Of_Elements);
3583 template <
size_t Active_Bits,
typename TElement>
3586 return !(lhs == rhs);
3594 template <
size_t Active_Bits,
typename TElement>
3597 const char Storage_Model = etl::bitset<Active_Bits, TElement>::Storage_Model;
3598 const size_t Number_Of_Elements = etl::bitset<Active_Bits, TElement>::Number_Of_Elements;
3600 typename etl::bitset_ext<Active_Bits, TElement>::const_span_type lhs_span = lhs.span();
3601 typename etl::bitset<Active_Bits, TElement>::const_span_type rhs_span = rhs.span();
3605 return implementation::operator_equality(lhs_span.
begin(), rhs_span.
begin(), Number_Of_Elements);
3613 template <
size_t Active_Bits,
typename TElement>
3616 return !(lhs == rhs);
3624 template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3625 ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3629 typename etl::bitset<Active_Bits, TLhsElement>::const_span_type lhs_span = lhs.span();
3630 typename etl::bitset_ext<Active_Bits, TRhsElement>::const_span_type rhs_span = rhs.span();
3633 if ETL_IF_CONSTEXPR (
sizeof(TLhsElement) >
sizeof(TRhsElement))
3648 template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3649 ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3652 return !(lhs == rhs);
3660 template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3661 ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3665 typename etl::bitset_ext<Active_Bits, TLhsElement>::const_span_type lhs_span = lhs.span();
3666 typename etl::bitset<Active_Bits, TRhsElement>::const_span_type rhs_span = rhs.span();
3669 if ETL_IF_CONSTEXPR (
sizeof(TLhsElement) >
sizeof(TRhsElement))
3684 template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3685 ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3688 return !(lhs == rhs);
bool compare_bitset_spans(const TLhsSpan &lhs_span, const TRhsSpan &rhs_span)
Definition bitset_new.h:3444
The reference type returned.
Definition bitset_new.h:1712
ETL_CONSTEXPR14 bit_reference(const bit_reference &other) ETL_NOEXCEPT
Copy constructor.
Definition bitset_new.h:1720
ETL_CONSTEXPR14 bit_reference & operator=(const bit_reference &r) ETL_NOEXCEPT
Assignment operator.
Definition bitset_new.h:1746
ETL_CONSTEXPR14 bit_reference & operator=(bool b) ETL_NOEXCEPT
Assignment operator.
Definition bitset_new.h:1737
ETL_CONSTEXPR14 bit_reference & flip() ETL_NOEXCEPT
Flip the bit.
Definition bitset_new.h:1755
ETL_CONSTEXPR14 bool operator~() const ETL_NOEXCEPT
Return the logical inverse of the bit.
Definition bitset_new.h:1764
The reference type returned.
Definition bitset_new.h:2625
ETL_CONSTEXPR14 bit_reference & operator=(bool b) ETL_NOEXCEPT
Assignment operator.
Definition bitset_new.h:2650
ETL_CONSTEXPR14 bit_reference & operator=(const bit_reference &r) ETL_NOEXCEPT
Assignment operator.
Definition bitset_new.h:2659
ETL_CONSTEXPR14 bit_reference & flip() ETL_NOEXCEPT
Flip the bit.
Definition bitset_new.h:2668
ETL_CONSTEXPR14 bool operator~() const ETL_NOEXCEPT
Return the logical inverse of the bit.
Definition bitset_new.h:2677
ETL_CONSTEXPR14 bit_reference(const bit_reference &other) ETL_NOEXCEPT
Copy constructor.
Definition bitset_new.h:2633
bitset_ext
Definition bitset_new.h:2599
ETL_CONSTEXPR14 etl::enable_if< etl::is_same< TPString, constchar32_t * >::value, bitset_ext< Active_Bits, TElement > & >::type set(TPString text) ETL_NOEXCEPT
Set from a char32 string.
Definition bitset_new.h:2957
ETL_CONSTEXPR14 T extract() const
Definition bitset_new.h:3040
ETL_CONSTEXPR14 etl::enable_if< etl::is_same< TPString, constwchar_t * >::value, bitset_ext< Active_Bits, TElement > & >::type set(TPString text) ETL_NOEXCEPT
Set from a wide string.
Definition bitset_new.h:2933
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & from_string(const char32_t *text) ETL_NOEXCEPT
Set from a u32 string.
Definition bitset_new.h:2997
ETL_CONSTEXPR14 bitset_ext & operator=(const bitset_ext< Active_Bits, TElement > &other) ETL_NOEXCEPT
Assignment operator.
Definition bitset_new.h:2861
ETL_CONSTEXPR14 bool any() const ETL_NOEXCEPT
Are any of the bits set?
Definition bitset_new.h:3228
ETL_CONSTEXPR14 bitset_ext(TPString text, buffer_type &buffer, typename etl::enable_if< is_same< TPString, const char16_t * >::value >::type *=0) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:2829
static ETL_CONSTEXPR element_type all_set_element() ETL_NOEXCEPT
The value of a set element.
Definition bitset_new.h:3134
ETL_CONSTEXPR14 void swap(etl::bitset_ext< Active_Bits, TElement > &other) ETL_NOEXCEPT
swap
Definition bitset_new.h:3385
friend ETL_CONSTEXPR14 bool operator==(const bitset_ext< Active_Bits, TElement > &lhs, const bitset_ext< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
operator ==
Definition bitset_new.h:3369
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & flip(size_t position)
Flip the bit at the position.
Definition bitset_new.h:3256
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & from_string(const char *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:2967
ETL_CONSTEXPR14 size_t find_next(bool state, size_t position) const ETL_NOEXCEPT
Definition bitset_new.h:3311
static ETL_CONSTEXPR element_type top_mask() ETL_NOEXCEPT
The mask for the msb element.
Definition bitset_new.h:3150
ETL_CONSTEXPR14 bitset_ext(TPString text, element_type *pbuffer_, typename etl::enable_if< is_same< TPString, const char * >::value >::type *=0)
Construct from a string.
Definition bitset_new.h:2774
ETL_CONSTEXPR14 bitset_ext(TValue value, buffer_type &buffer, typename etl::enable_if< is_integral< TValue >::value >::type *=0) ETL_NOEXCEPT
Construct from a value.
Definition bitset_new.h:2764
ETL_CONSTEXPR14 bitset_ext(TPString text, element_type *pbuffer_, typename etl::enable_if< is_same< TPString, const char16_t * >::value >::type *=0)
Construct from a string.
Definition bitset_new.h:2818
unsigned long long to_ullong() const
Get as an unsigned long long.
Definition bitset_new.h:3062
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & operator<<=(size_t shift) ETL_NOEXCEPT
operator <<=
Definition bitset_new.h:3349
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & operator|=(const bitset_ext< Active_Bits, TElement > &other) ETL_NOEXCEPT
operator |=
Definition bitset_new.h:3329
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & operator^=(const bitset_ext< Active_Bits, TElement > &other) ETL_NOEXCEPT
operator ^=
Definition bitset_new.h:3339
ETL_CONSTEXPR14 bool any(element_type mask) const ETL_NOEXCEPT
Are any of the mask bits set?
Definition bitset_new.h:3236
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & reset() ETL_NOEXCEPT
Reset all of the bits.
Definition bitset_new.h:3072
ETL_CONSTEXPR14 bool none() const ETL_NOEXCEPT
Are none of the bits set?
Definition bitset_new.h:3210
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & set() ETL_NOEXCEPT
Set all of the bits.
Definition bitset_new.h:2871
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & reset(size_t position)
Reset the bit at the position.
Definition bitset_new.h:3082
ETL_CONSTEXPR14 bitset_ext(TPString text, buffer_type &buffer, typename etl::enable_if< is_same< TPString, const wchar_t * >::value >::type *=0) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:2807
ETL_CONSTEXPR14 bitset_ext(element_type *pbuffer_)
Definition bitset_new.h:2709
ETL_CONSTEXPR14 T value() const ETL_NOEXCEPT
Get as an integral value.
Definition bitset_new.h:3008
ETL_CONSTEXPR14 bitset_ext(unsigned long long value, element_type *pbuffer_)
Construct from a value.
Definition bitset_new.h:2753
static ETL_CONSTEXPR size_t bits_per_element() ETL_NOEXCEPT
The number of bits in an element.
Definition bitset_new.h:3158
ETL_CONSTEXPR14 bitset_ext(TPString text, element_type *pbuffer_, typename etl::enable_if< is_same< TPString, const char32_t * >::value >::type *=0)
Construct from a string.
Definition bitset_new.h:2840
ETL_CONSTEXPR14 etl::enable_if< etl::is_same< TPString, constchar * >::value, bitset_ext< Active_Bits, TElement > & >::type set(TPString text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:2920
ETL_CONSTEXPR14 bool operator[](size_t position) const ETL_NOEXCEPT
Read [] operator.
Definition bitset_new.h:3268
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & operator&=(const bitset_ext< Active_Bits, TElement > &other) ETL_NOEXCEPT
operator &=
Definition bitset_new.h:3319
static ETL_CONSTEXPR size_t size() ETL_NOEXCEPT
The number of bits in the bitset.
Definition bitset_new.h:3118
static ETL_CONSTEXPR size_t number_of_elements() ETL_NOEXCEPT
The number of storage elements in the bitset.
Definition bitset_new.h:3126
ETL_CONSTEXPR14 bool test(size_t position) const
Definition bitset_new.h:3096
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & flip() ETL_NOEXCEPT
Flip all of the bits.
Definition bitset_new.h:3246
static ETL_CONSTEXPR size_t allocated_bits() ETL_NOEXCEPT
The total number of bits of storage, including unused.
Definition bitset_new.h:3166
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & set(size_t position, bool value=true)
Set the bit at the position.
Definition bitset_new.h:2881
ETL_CONSTEXPR14 bitset_ext(TPString text, element_type *pbuffer_, typename etl::enable_if< is_same< TPString, const wchar_t * >::value >::type *=0)
Construct from a string.
Definition bitset_new.h:2796
unsigned long to_ulong() const
Get as an unsigned long.
Definition bitset_new.h:3052
ETL_CONSTEXPR14 bool test() const
Definition bitset_new.h:3108
ETL_CONSTEXPR14 bitset_ext(TPString text, buffer_type &buffer, typename etl::enable_if< is_same< TPString, const char32_t * >::value >::type *=0) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:2851
ETL_CONSTEXPR14 etl::enable_if< etl::is_same< TPString, constchar16_t * >::value, bitset_ext< Active_Bits, TElement > & >::type set(TPString text) ETL_NOEXCEPT
Set from a char16 string.
Definition bitset_new.h:2945
ETL_CONSTEXPR14 bit_reference operator[](size_t position) ETL_NOEXCEPT
Write [] operator.
Definition bitset_new.h:3276
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & from_string(const wchar_t *text) ETL_NOEXCEPT
Set from a wide string.
Definition bitset_new.h:2977
ETL_CONSTEXPR14 bool none(element_type mask) const ETL_NOEXCEPT
Are none of the mask bits set?
Definition bitset_new.h:3218
ETL_CONSTEXPR14 size_t count() const ETL_NOEXCEPT
Count the number of bits set.
Definition bitset_new.h:3184
ETL_CONSTEXPR14 bitset_ext(const bitset_ext< Active_Bits, TElement > &other, buffer_type &buffer) ETL_NOEXCEPT
Construct copy.
Definition bitset_new.h:2739
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & set()
Set the bit at the position.
Definition bitset_new.h:2907
ETL_CONSTEXPR14 bitset_ext(const bitset_ext< Active_Bits, TElement > &other, element_type *pbuffer_)
Construct copy.
Definition bitset_new.h:2729
static ETL_CONSTEXPR etl::bitset_storage_model storage_model() ETL_NOEXCEPT
Definition bitset_new.h:3176
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & operator>>=(size_t shift) ETL_NOEXCEPT
operator >>=
Definition bitset_new.h:3359
friend ETL_CONSTEXPR14 bool operator!=(const bitset_ext< Active_Bits, TElement > &lhs, const bitset_ext< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
operator !=
Definition bitset_new.h:3377
ETL_CONSTEXPR14 size_t find_first(bool state) const ETL_NOEXCEPT
Definition bitset_new.h:3300
static ETL_CONSTEXPR element_type all_clear_element() ETL_NOEXCEPT
The value of a clear element.
Definition bitset_new.h:3142
ETL_CONSTEXPR14 const_span_type span() const ETL_NOEXCEPT
Definition bitset_new.h:3403
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & set(bool value=true)
Set the bit at the position.
Definition bitset_new.h:2894
ETL_CONSTEXPR14 bitset_ext(TPString text, buffer_type &buffer, typename etl::enable_if< is_same< TPString, const char * >::value >::type *=0) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:2785
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:3289
ETL_CONSTEXPR14 bitset_ext(const bitset_ext< Active_Bits, TElement > &other) ETL_NOEXCEPT ETL_DELETE
Copy Constructor (Deleted).
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & from_string(const char16_t *text) ETL_NOEXCEPT
Set from a u16 string.
Definition bitset_new.h:2987
ETL_CONSTEXPR14 bitset_ext(buffer_type &buffer)
Default constructor.
Definition bitset_new.h:2719
ETL_CONSTEXPR14 span_type span() ETL_NOEXCEPT
Definition bitset_new.h:3394
ETL_CONSTEXPR14 T extract(size_t position, size_t length=etl::integral_limits< T >::bits)
Definition bitset_new.h:3021
Definition bitset_new.h:1602
Definition bitset_new.h:166
Span - Fixed Extent.
Definition span.h:208
ETL_NODISCARD ETL_CONSTEXPR iterator begin() const ETL_NOEXCEPT
Returns an iterator to the beginning of the span.
Definition span.h:484
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:918
ETL_CONSTEXPR14 TReturn sign_extend(TValue value)
Definition binary.h:273
static ETL_CONSTEXPR14 bool operator_equality(const_pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t number_of_elements) ETL_NOEXCEPT
operator_equality
Definition bitset_new.h:1533
ETL_CONSTEXPR14 bool none(element_type mask) const ETL_NOEXCEPT
Are none of the mask bits set?
Definition bitset_new.h:2221
static ETL_CONSTEXPR14 T extract(const_pointer pbuffer)
Extract an integral value from an arbitrary position and length.
Definition bitset_new.h:1239
ETL_CONSTEXPR14 size_t find_next(bool state, size_t position) const ETL_NOEXCEPT
Definition bitset_new.h:2314
static ETL_CONSTEXPR14 size_t find_next(const_pointer pbuffer, size_t number_of_elements, size_t total_bits, bool state, size_t position) ETL_NOEXCEPT
Definition bitset_new.h:1278
ETL_CONSTEXPR14 T extract(size_t position, size_t length=etl::integral_limits< T >::bits) const
Definition bitset_new.h:2024
static ETL_CONSTEXPR14 etl::make_unsigned< T >::type extract_from_multiple_elements(const element_type *pbuffer, size_t element_index, size_t active_bits_in_msb, size_t length) ETL_NOEXCEPT
Extract an value from multiple elements.
Definition bitset_new.h:1101
static ETL_CONSTEXPR14 void set_all(pointer pbuffer, size_t number_of_elements, element_type top_mask) ETL_NOEXCEPT
Set all bits.
Definition bitset_new.h:865
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & set(size_t position, bool value=true)
Set the bit at the position.
Definition bitset_new.h:1884
static ETL_CONSTEXPR14 etl::enable_if< value_is_in_one_element< Position, Length, Bits_Per_Element >::value, typenameetl::make_unsigned< T >::type >::type extract_from_buffer(const_pointer pbuffer)
Definition bitset_new.h:1188
static ETL_CONSTEXPR14 etl::make_unsigned< T >::type extract_from_buffer(const_pointer pbuffer, size_t position, size_t length) ETL_NOEXCEPT
Definition bitset_new.h:1149
ETL_CONSTEXPR14 bitset(const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
Copy constructor.
Definition bitset_new.h:1805
ibitset & initialise(unsigned long long value)
Initialise from an unsigned long long.
Definition bitset_legacy.h:1006
static ETL_CONSTEXPR14 void swap(pointer lhs_pbuffer, pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
swap
Definition bitset_new.h:735
ETL_CONSTEXPR14 etl::enable_if< etl::is_same< TPString, constchar16_t * >::value, bitset< Active_Bits, TElement > & >::type set(TPString text) ETL_NOEXCEPT
Set from a char16 string.
Definition bitset_new.h:1947
static ETL_CONSTEXPR14 void reset_position(pointer pbuffer, size_t position)
Reset the bit at the position.
Definition bitset_new.h:294
static ETL_CONSTEXPR14 void flip_all(pointer pbuffer, size_t) ETL_NOEXCEPT
Flip all of the bits.
Definition bitset_new.h:557
static ETL_CONSTEXPR14 etl::enable_if<!value_is_in_one_element< Position, Length, Bits_Per_Element >::value, typenameetl::make_unsigned< T >::type >::type extract_from_buffer(const_pointer pbuffer)
Definition bitset_new.h:1206
static ETL_CONSTEXPR14 bool any(const_pointer pbuffer, size_t, element_type mask) ETL_NOEXCEPT
Are any of the mask bits set?
Definition bitset_new.h:549
static ETL_CONSTEXPR element_type all_set_element() ETL_NOEXCEPT
The value of a set element.
Definition bitset_new.h:2137
static ETL_CONSTEXPR14 void set_position(pointer pbuffer, size_t position, bool value=true)
Set the bit at the position.
Definition bitset_new.h:230
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & from_string(const char32_t *text) ETL_NOEXCEPT
Set from a u32 string.
Definition bitset_new.h:2000
static 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:934
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator&=(const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
operator &=
Definition bitset_new.h:2334
static ETL_CONSTEXPR14 T extract(const_pointer pbuffer)
Extract an integral value from an arbitrary position and length.
Definition bitset_new.h:470
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator>>=(size_t shift) ETL_NOEXCEPT
operator >>=
Definition bitset_new.h:2441
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & from_string(const char16_t *text) ETL_NOEXCEPT
Set from a u16 string.
Definition bitset_new.h:1990
static ETL_CONSTEXPR14 void flip_all(pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
Flip all of the bits.
Definition bitset_new.h:1256
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & set() ETL_NOEXCEPT
Set all of the bits.
Definition bitset_new.h:1874
static ETL_CONSTEXPR14 size_t find_next(const_pointer pbuffer, size_t, size_t active_bits, bool state, size_t position) ETL_NOEXCEPT
Definition bitset_new.h:608
static ETL_CONSTEXPR14 void initialise(pointer pbuffer, size_t, unsigned long long value) ETL_NOEXCEPT
Initialise from an unsigned long long.
Definition bitset_new.h:727
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator>>(size_t shift) const ETL_NOEXCEPT
operator >>
Definition bitset_new.h:2429
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator<<(size_t shift) const ETL_NOEXCEPT
operator <<
Definition bitset_new.h:2400
static ETL_CONSTEXPR14 TString to_string(const_pointer pbuffer, size_t active_bits, typename TString::value_type zero, typename TString::value_type one)
Returns a string representing the bitset.
Definition bitset_new.h:1329
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator~() const ETL_NOEXCEPT
operator ~
Definition bitset_new.h:2388
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & flip() ETL_NOEXCEPT
Flip all of the bits.
Definition bitset_new.h:2249
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & from_string(const char *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1970
ETL_CONSTEXPR14 const_span_type span() const ETL_NOEXCEPT
Definition bitset_new.h:2492
static 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:964
ETL_CONSTEXPR14 bool none() const ETL_NOEXCEPT
Are none of the bits set?
Definition bitset_new.h:2213
ETL_CONSTEXPR14 bitset(TPString text, typename etl::enable_if< is_same< TPString, const char16_t * >::value >::type *=0) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:1845
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator<<=(size_t shift) ETL_NOEXCEPT
operator <<=
Definition bitset_new.h:2412
static ETL_CONSTEXPR14 void flip_position(pointer pbuffer, size_t position)
Flip the bit at the position.
Definition bitset_new.h:573
static 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:994
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator&(const bitset< Active_Bits, TElement > &other) const ETL_NOEXCEPT
operator &
Definition bitset_new.h:2322
ETL_CONSTEXPR14 bit_reference operator[](size_t position) ETL_NOEXCEPT
Write [] operator.
Definition bitset_new.h:2279
static ETL_CONSTEXPR14 void set_position(pointer pbuffer, bool value=true)
Set the bit at the position.
Definition bitset_new.h:897
static ETL_CONSTEXPR14 void operator_assignment(pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t number_of_elements) ETL_NOEXCEPT
operator assignment
Definition bitset_new.h:1349
static ETL_CONSTEXPR14 bool none(const_pointer pbuffer, size_t, element_type mask) ETL_NOEXCEPT
Are none of the mask bits set?
Definition bitset_new.h:533
ETL_CONSTEXPR14 size_t find_first(bool state) const ETL_NOEXCEPT
Definition bitset_new.h:2303
static ETL_CONSTEXPR14 void set_position(pointer pbuffer)
Set the bit at the position.
Definition bitset_new.h:916
ETL_CONSTEXPR14 bitset(TValue value, typename etl::enable_if< is_integral< TValue >::value >::type *=0) ETL_NOEXCEPT
Construct from a value.
Definition bitset_new.h:1815
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & from_string(const wchar_t *text) ETL_NOEXCEPT
Set from a wide string.
Definition bitset_new.h:1980
static ETL_CONSTEXPR14 void operator_and(pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t number_of_elements) ETL_NOEXCEPT
operator and
Definition bitset_new.h:1362
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & flip(size_t position)
Flip the bit at the position.
Definition bitset_new.h:2259
etl::enable_if< etl::is_integral< T >::value, T >::type value() const
Put to a value.
Definition bitset_legacy.h:1299
static ETL_CONSTEXPR size_t number_of_elements() ETL_NOEXCEPT
The number of storage elements in the bitset.
Definition bitset_new.h:2129
static ETL_CONSTEXPR14 size_t count(const_pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
Count the number of bits set.
Definition bitset_new.h:792
static ETL_CONSTEXPR14 void operator_or(pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
Definition bitset_new.h:662
ETL_CONSTEXPR14 void swap(etl::bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
swap
Definition bitset_new.h:2474
static ETL_CONSTEXPR14 T extract(const_pointer pbuffer, size_t position, size_t length=etl::integral_limits< T >::bits)
Extract an integral value from an arbitrary position and length.
Definition bitset_new.h:1221
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:2292
static ETL_CONSTEXPR14 void from_string(pointer pbuffer, size_t, size_t active_bits, const wchar_t *text) ETL_NOEXCEPT
Set from a wide string.
Definition bitset_new.h:336
static ETL_CONSTEXPR size_t allocated_bits() ETL_NOEXCEPT
The total number of bits of storage, including unused.
Definition bitset_new.h:2169
static ETL_CONSTEXPR14 void operator_shift_left(pointer pbuffer, size_t number_of_elements, size_t active_bits, size_t shift) ETL_NOEXCEPT
operator_shift_left
Definition bitset_new.h:1413
static ETL_CONSTEXPR element_type top_mask() ETL_NOEXCEPT
The mask for the msb element.
Definition bitset_new.h:2161
static ETL_CONSTEXPR14 void operator_or(pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t number_of_elements) ETL_NOEXCEPT
operator or
Definition bitset_new.h:1375
static ETL_CONSTEXPR14 void operator_shift_right(pointer pbuffer, size_t, size_t active_bits, size_t shift) ETL_NOEXCEPT
operator_shift_right
Definition bitset_new.h:703
ETL_CONSTEXPR14 bool test(size_t position) const
Definition bitset_new.h:2099
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_legacy.h:1351
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:2011
static ETL_CONSTEXPR14 bool any(const_pointer pbuffer, size_t) ETL_NOEXCEPT
Are any of the bits set?
Definition bitset_new.h:541
ETL_CONSTEXPR14 bool any(element_type mask) const ETL_NOEXCEPT
Are any of the mask bits set?
Definition bitset_new.h:2239
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator^=(const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
operator ^=
Definition bitset_new.h:2378
ETL_CONSTEXPR14 bitset(TPString text, typename etl::enable_if< is_same< TPString, const char32_t * >::value >::type *=0) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:1855
static ETL_CONSTEXPR element_type all_clear_element() ETL_NOEXCEPT
The value of a clear element.
Definition bitset_new.h:2145
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & reset() ETL_NOEXCEPT
Reset all of the bits.
Definition bitset_new.h:2075
static ETL_CONSTEXPR14 void reset_all(pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
Reset all of the bits.
Definition bitset_new.h:1054
static ETL_CONSTEXPR14 void from_string(pointer pbuffer, size_t, size_t active_bits, const char *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:303
static ETL_CONSTEXPR14 void operator_shift_left(pointer pbuffer, size_t, size_t active_bits, size_t shift) ETL_NOEXCEPT
operator_shift_left
Definition bitset_new.h:688
static ETL_CONSTEXPR14 void operator_xor(pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
Definition bitset_new.h:671
static ETL_CONSTEXPR14 T value(const_pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
Get as a value.
Definition bitset_new.h:1077
static ETL_CONSTEXPR14 void flip_bits(pointer pbuffer, element_type mask=etl::integral_limits< element_type >::max) ETL_NOEXCEPT
Flip some of the bits.
Definition bitset_new.h:565
static ETL_CONSTEXPR14 bool none(const_pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
Are none of the bits set?
Definition bitset_new.h:830
static ETL_CONSTEXPR14 void flip_position(pointer pbuffer, size_t position) ETL_NOEXCEPT
Flip the bit at the position.
Definition bitset_new.h:1264
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator|(const bitset< Active_Bits, TElement > &other) const ETL_NOEXCEPT
operator |
Definition bitset_new.h:2344
static ETL_CONSTEXPR14 void set_position(pointer pbuffer, size_t position, bool value=true) ETL_NOEXCEPT
Set the bit at the position.
Definition bitset_new.h:878
static ETL_CONSTEXPR14 void swap(pointer pbuffer1, pointer pbuffer2, size_t number_of_elements)
Swap bitset buffers.
Definition bitset_new.h:1591
static ETL_CONSTEXPR14 void operator_not(pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
operator not
Definition bitset_new.h:1401
ETL_CONSTEXPR14 bitset & operator=(const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
Assignment operator.
Definition bitset_new.h:1864
static ETL_CONSTEXPR size_t bits_per_element() ETL_NOEXCEPT
The number of bits in an element.
Definition bitset_new.h:2153
ETL_CONSTEXPR14 size_t count() const ETL_NOEXCEPT
Count the number of bits set.
Definition bitset_new.h:2187
static ETL_CONSTEXPR14 etl::enable_if< etl::integral_limits< TElementType >::bits==etl::integral_limits< unsignedlonglong >::bits, void >::type initialise(pointer pbuffer, size_t number_of_elements, unsigned long long value) ETL_NOEXCEPT
Definition bitset_new.h:1546
bitset()
Definition bitset_legacy.h:1137
static ETL_CONSTEXPR14 T value(const_pointer pbuffer, size_t) ETL_NOEXCEPT
Get as an integral value.
Definition bitset_new.h:436
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & set(bool value=true)
Set the bit at the position.
Definition bitset_new.h:1897
ETL_CONSTEXPR14 bool operator[](size_t position) const ETL_NOEXCEPT
Read [] operator.
Definition bitset_new.h:2271
static ETL_CONSTEXPR14 void reset_all(pointer pbuffer, size_t) ETL_NOEXCEPT
Reset all of the bits.
Definition bitset_new.h:283
ETL_CONSTEXPR14 bitset(TPString text, typename etl::enable_if< is_same< TPString, const wchar_t * >::value >::type *=0) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:1835
ETL_CONSTEXPR14 etl::enable_if< etl::is_same< TPString, constchar * >::value, bitset< Active_Bits, TElement > & >::type set(TPString text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1923
static ETL_CONSTEXPR14 bool any(const_pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
Are any of the bits set?
Definition bitset_new.h:846
static ETL_CONSTEXPR14 bool test(const_pointer pbuffer, size_t position)
Definition bitset_new.h:492
static ETL_CONSTEXPR14 void reset_position(pointer pbuffer, size_t position) ETL_NOEXCEPT
Reset the bit at the position.
Definition bitset_new.h:1065
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator^(const bitset< Active_Bits, TElement > &other) const ETL_NOEXCEPT
operator ^
Definition bitset_new.h:2366
static ETL_CONSTEXPR14 void set_all(pointer pbuffer, size_t, element_type top_mask) ETL_NOEXCEPT
Set all of the bits.
Definition bitset_new.h:222
static ETL_CONSTEXPR14 bool none(const_pointer pbuffer, size_t) ETL_NOEXCEPT
Are none of the bits set?
Definition bitset_new.h:525
static 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:1024
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & reset(size_t position)
Reset the bit at the position.
Definition bitset_new.h:2085
ETL_CONSTEXPR14 etl::enable_if< etl::is_same< TPString, constwchar_t * >::value, bitset< Active_Bits, TElement > & >::type set(TPString text) ETL_NOEXCEPT
Set from a wide string.
Definition bitset_new.h:1935
static ETL_CONSTEXPR size_t size() ETL_NOEXCEPT
The number of bits in the bitset.
Definition bitset_new.h:2121
ETL_CONSTEXPR14 bitset(TPString text, typename etl::enable_if< is_same< TPString, const char * >::value >::type *=0) ETL_NOEXCEPT
Construct from a string.
Definition bitset_new.h:1825
static ETL_CONSTEXPR14 void from_string(pointer pbuffer, size_t, size_t active_bits, const char32_t *text) ETL_NOEXCEPT
Set from a u32 string.
Definition bitset_new.h:402
static ETL_CONSTEXPR14 void operator_shift_right(pointer pbuffer, size_t number_of_elements, size_t active_bits, size_t shift) ETL_NOEXCEPT
operator_shift_right
Definition bitset_new.h:1472
static ETL_CONSTEXPR14 void operator_and(pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
Definition bitset_new.h:653
static ETL_CONSTEXPR14 void set_position(pointer pbuffer)
Set the bit at the position.
Definition bitset_new.h:266
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & set()
Set the bit at the position.
Definition bitset_new.h:1910
static ETL_CONSTEXPR14 T extract(const_pointer pbuffer, size_t position, size_t length=etl::integral_limits< T >::bits)
Extract an integral value from an arbitrary position and length.
Definition bitset_new.h:445
unsigned long long to_ullong() const
Get as an unsigned long long.
Definition bitset_new.h:2065
ETL_CONSTEXPR14 bool any() const ETL_NOEXCEPT
Are any of the bits set?
Definition bitset_new.h:2231
static ETL_CONSTEXPR14 bool operator_equality(const_pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
operator_equality
Definition bitset_new.h:718
ETL_CONSTEXPR14 bool test() const
Definition bitset_new.h:2111
ETL_CONSTEXPR14 span_type span() ETL_NOEXCEPT
Definition bitset_new.h:2483
static ETL_CONSTEXPR14 void from_string(pointer pbuffer, size_t, size_t active_bits, const char16_t *text) ETL_NOEXCEPT
Set from a u16 string.
Definition bitset_new.h:369
static ETL_CONSTEXPR14 void set_position(pointer pbuffer, bool value=true)
Set the bit at the position.
Definition bitset_new.h:248
unsigned long to_ulong() const
Get as an unsigned long.
Definition bitset_new.h:2055
static ETL_CONSTEXPR14 void operator_xor(pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t number_of_elements) ETL_NOEXCEPT
operator xor
Definition bitset_new.h:1388
friend ETL_CONSTEXPR14 bool operator==(const bitset< Active_Bits, TElement > &lhs, const bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
operator ==
Definition bitset_new.h:2458
static ETL_CONSTEXPR14 etl::enable_if< etl::integral_limits< TElementType >::bits!=etl::integral_limits< unsignedlonglong >::bits, void >::type initialise(pointer pbuffer, size_t number_of_elements, unsigned long long value) ETL_NOEXCEPT
Definition bitset_new.h:1568
static ETL_CONSTEXPR14 size_t count(const_pointer pbuffer, size_t) ETL_NOEXCEPT
Count the number of bits set.
Definition bitset_new.h:501
static ETL_CONSTEXPR14 void operator_assignment(pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
Definition bitset_new.h:644
static ETL_CONSTEXPR14 bool test(const_pointer pbuffer, size_t position) ETL_NOEXCEPT
Definition bitset_new.h:781
ETL_CONSTEXPR14 T extract() const
Definition bitset_new.h:2043
static ETL_CONSTEXPR14 void operator_not(pointer pbuffer, size_t) ETL_NOEXCEPT
Definition bitset_new.h:680
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator|=(const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
operator |=
Definition bitset_new.h:2356
friend ETL_CONSTEXPR14 bool operator!=(const bitset< Active_Bits, TElement > &lhs, const bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
operator !=
Definition bitset_new.h:2466
static ETL_CONSTEXPR14 TString to_string(const_pointer pbuffer, size_t active_bits, typename TString::value_type zero=typename TString::value_type('0'), typename TString::value_type one=typename TString::value_type('1'))
Returns a string representing the bitset.
Definition bitset_new.h:583
ETL_CONSTEXPR14 etl::enable_if< etl::is_same< TPString, constchar32_t * >::value, bitset< Active_Bits, TElement > & >::type set(TPString text) ETL_NOEXCEPT
Set from a char32 string.
Definition bitset_new.h:1959
ETL_CONSTEXPR14 bitset() ETL_NOEXCEPT
Default constructor.
Definition bitset_new.h:1796
static ETL_CONSTEXPR etl::bitset_storage_model storage_model() ETL_NOEXCEPT
Definition bitset_new.h:2179
Bitset forward declaration.
Definition bitset_legacy.h:1124
Definition bitset_legacy.h:83
Definition bitset_new.h:198
Definition bitset_new.h:152
Definition bitset_legacy.h:125
Definition bitset_new.h:124
Definition bitset_new.h:90
#define ETL_ASSERT(b, e)
Definition error_handler.h:511
Definition exception.h:59
Definition integral_limits.h:517
#define ETL_DECLARE_ENUM_TYPE(TypeName, ValueType)
Definition enum_type.h:90
ETL_CONSTEXPR14 void swap(etl::typed_storage_ext< T > &lhs, etl::typed_storage_ext< T > &rhs) ETL_NOEXCEPT
Swap two etl::typed_storage_ext.
Definition alignment.h:856
ETL_CONSTEXPR14 bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1078
ETL_CONSTEXPR TContainer::pointer data(TContainer &container)
Definition iterator.h:1470
etl::byte operator|(etl::byte lhs, etl::byte rhs)
Or.
Definition byte.h:250
etl::byte operator&(etl::byte lhs, etl::byte rhs)
And.
Definition byte.h:258
ETL_CONSTEXPR14 bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1090
etl::byte operator^(etl::byte lhs, etl::byte rhs)
Exclusive Or.
Definition byte.h:266
ETL_CONSTEXPR14 size_t strlen(const T *t) ETL_NOEXCEPT
Alternative strlen for all character types.
Definition char_traits.h:293
Check to see if the requested extract is contained within one element.
Definition bitset_new.h:771