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 element_type mask = element_type(element_type(1) << (string_length - 1U));
316 for (
size_t i = 0U; i < string_length; ++i)
318 if (text[i] == ETL_STR(
'1'))
331 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t ,
size_t active_bits,
const wchar_t* text) ETL_NOEXCEPT
335 if (text != ETL_NULLPTR)
340 string_length = etl::min(active_bits, string_length);
342 element_type mask = element_type(element_type(1) << (string_length - 1U));
344 for (
size_t i = 0U; i < string_length; ++i)
346 if (text[i] == ETL_STRL(
'1'))
359 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t ,
size_t active_bits,
const char16_t* text) ETL_NOEXCEPT
363 if (text != ETL_NULLPTR)
368 string_length = etl::min(active_bits, string_length);
370 element_type mask = element_type(element_type(1) << (string_length - 1U));
372 for (
size_t i = 0U; i < string_length; ++i)
374 if (text[i] == ETL_STRu(
'1'))
387 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t ,
size_t active_bits,
const char32_t* text) ETL_NOEXCEPT
391 if (text != ETL_NULLPTR)
396 string_length = etl::min(active_bits, string_length);
398 element_type mask = element_type(element_type(1) << (string_length - 1U));
400 for (
size_t i = 0U; i < string_length; ++i)
402 if (text[i] == ETL_STRU(
'1'))
415 template <
typename T>
416 static ETL_CONSTEXPR14 T
value(const_pointer pbuffer,
size_t ) ETL_NOEXCEPT
424 template <
typename T>
427 typedef typename etl::make_unsigned<T>::type unsigned_t;
429 const unsigned_t Mask = etl::make_lsb_mask<unsigned_t>(length);
430 const unsigned_t Shift = position % Bits_Per_Element;
432 unsigned_t
value =
static_cast<unsigned_t
>(*pbuffer >> Shift) & Mask;
439 return static_cast<T
>(
value);
446 template <typename T, size_t Position, size_t Length = etl::integral_limits<T>::bits>
448 template <
typename T,
size_t Position,
size_t Length>
450 static ETL_CONSTEXPR14 T
extract(const_pointer pbuffer)
452 typedef typename etl::make_unsigned<T>::type unsigned_t;
454 const unsigned_t Mask = etl::make_lsb_mask<unsigned_t>(Length);
455 const unsigned_t Shift = Position % Bits_Per_Element;
457 unsigned_t
value =
static_cast<unsigned_t
>(*pbuffer >> Shift) & Mask;
464 return static_cast<T
>(
value);
472 static ETL_CONSTEXPR14
bool test(const_pointer pbuffer,
size_t position)
474 const element_type mask = element_type(element_type(1) << position);
475 return (*pbuffer & mask) != 0U;
481 static ETL_CONSTEXPR14
size_t count(const_pointer pbuffer,
size_t ) ETL_NOEXCEPT
489 static ETL_CONSTEXPR14
bool all(const_pointer pbuffer,
size_t , element_type top_mask) ETL_NOEXCEPT
491 return (*pbuffer & top_mask) == top_mask;
497 static ETL_CONSTEXPR14
bool all(const_pointer pbuffer,
size_t , element_type top_mask, element_type mask) ETL_NOEXCEPT
499 return (*pbuffer & top_mask & mask) == mask;
505 static ETL_CONSTEXPR14
bool none(const_pointer pbuffer,
size_t ) ETL_NOEXCEPT
507 return *pbuffer == All_Clear_Element;
513 static ETL_CONSTEXPR14
bool none(const_pointer pbuffer,
size_t , element_type mask) ETL_NOEXCEPT
515 return (*pbuffer & mask) == All_Clear_Element;
521 static ETL_CONSTEXPR14
bool any(const_pointer pbuffer,
size_t ) ETL_NOEXCEPT
523 return *pbuffer != All_Clear_Element;
529 static ETL_CONSTEXPR14
bool any(const_pointer pbuffer,
size_t , element_type mask) ETL_NOEXCEPT
531 return (*pbuffer & mask) != All_Clear_Element;
537 static ETL_CONSTEXPR14
void flip_all(pointer pbuffer,
size_t ) ETL_NOEXCEPT
539 *pbuffer = ~*pbuffer;
555 const element_type mask = element_type(element_type(1) << position);
562 template <
typename TString>
563 static ETL_CONSTEXPR14 TString
to_string(const_pointer pbuffer,
size_t active_bits,
564 typename TString::value_type zero =
typename TString::value_type(
'0'),
565 typename TString::value_type one =
typename TString::value_type(
'1'))
569 result.resize(active_bits,
'\0');
574 for (
size_t i = active_bits; i > 0; --i)
576 result[active_bits - i] =
test(pbuffer, i - 1) ? one : zero;
588 static ETL_CONSTEXPR14
size_t find_next(const_pointer pbuffer,
size_t ,
size_t active_bits,
bool state,
size_t position)
591 if (position < active_bits)
594 size_t bit = position;
596 element_type mask = 1U << position;
599 if ((state && (*pbuffer != All_Clear_Element)) || (!state && (*pbuffer != All_Set_Element)))
602 while (
bit < active_bits)
605 if (((*pbuffer & mask) != 0) == state)
624 static ETL_CONSTEXPR14
void operator_assignment(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t ) ETL_NOEXCEPT
626 *lhs_pbuffer = *rhs_pbuffer;
633 static ETL_CONSTEXPR14
void operator_and(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t ) ETL_NOEXCEPT
635 *lhs_pbuffer &= *rhs_pbuffer;
642 static ETL_CONSTEXPR14
void operator_or(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t ) ETL_NOEXCEPT
644 *lhs_pbuffer |= *rhs_pbuffer;
651 static ETL_CONSTEXPR14
void operator_xor(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t ) ETL_NOEXCEPT
653 *lhs_pbuffer ^= *rhs_pbuffer;
660 static ETL_CONSTEXPR14
void operator_not(pointer pbuffer,
size_t ) ETL_NOEXCEPT
662 *pbuffer = ~*pbuffer;
668 static ETL_CONSTEXPR14
void operator_shift_left(pointer pbuffer,
size_t ,
size_t active_bits,
size_t shift) ETL_NOEXCEPT
670 if (shift >= active_bits)
683 static ETL_CONSTEXPR14
void operator_shift_right(pointer pbuffer,
size_t ,
size_t active_bits,
size_t shift) ETL_NOEXCEPT
685 if (shift >= active_bits)
698 static ETL_CONSTEXPR14
bool operator_equality(const_pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t ) ETL_NOEXCEPT
700 return (*lhs_pbuffer == *rhs_pbuffer);
706 template <
typename TElementType>
707 static ETL_CONSTEXPR14
void initialise(pointer pbuffer,
size_t ,
unsigned long long value) ETL_NOEXCEPT
709 *pbuffer =
static_cast<TElementType
>(
value);
715 static ETL_CONSTEXPR14
void swap(pointer lhs_pbuffer, pointer rhs_pbuffer,
size_t ) ETL_NOEXCEPT
717 element_type temp = *lhs_pbuffer;
718 *lhs_pbuffer = *rhs_pbuffer;
727 template <
typename TElement>
736 using typename etl::private_bitset::bitset_impl_common<TElement>::element_type;
737 using typename etl::private_bitset::bitset_impl_common<TElement>::pointer;
738 using typename etl::private_bitset::bitset_impl_common<TElement>::const_pointer;
749 template <
size_t Position,
size_t Length,
size_t Bits_Per_Element>
753 ETL_CONSTANT
bool value = ((Position + Length - 1) >> etl::log2<Bits_Per_Element>::value) == (Position >> etl::log2<Bits_Per_Element>::value);
761 static ETL_CONSTEXPR14
bool test(const_pointer pbuffer,
size_t position) ETL_NOEXCEPT
763 size_t index = position >> etl::log2<Bits_Per_Element>::value;
764 element_type mask = element_type(1) << (position & (Bits_Per_Element - 1));
766 return (pbuffer[index] & mask) != 0;
772 static ETL_CONSTEXPR14
size_t count(const_pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
776 while (number_of_elements-- != 0)
787 static ETL_CONSTEXPR14
bool all(const_pointer pbuffer,
size_t number_of_elements, element_type top_mask) ETL_NOEXCEPT
790 while (number_of_elements-- != 1U)
792 if (*pbuffer++ != All_Set_Element)
799 if ((*pbuffer & top_mask) != top_mask)
810 static ETL_CONSTEXPR14
bool none(const_pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
812 while (number_of_elements-- != 0)
826 static ETL_CONSTEXPR14
bool any(const_pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
828 bool any_set =
false;
830 while (number_of_elements-- != 0)
832 if (*pbuffer++ != All_Clear_Element)
845 static ETL_CONSTEXPR14
void set_all(pointer pbuffer,
size_t number_of_elements, element_type top_mask) ETL_NOEXCEPT
847 while (number_of_elements-- != 1U)
849 *pbuffer++ = All_Set_Element;
852 *pbuffer = (All_Set_Element & top_mask);
858 static ETL_CONSTEXPR14
void set_position(pointer pbuffer,
size_t position,
bool value =
true) ETL_NOEXCEPT
860 size_t index = position >> etl::log2<Bits_Per_Element>::value;
861 element_type
bit = element_type(1) << (position & (Bits_Per_Element - 1));
865 pbuffer[index] |=
bit;
869 pbuffer[index] &=
~bit;
876 template <
size_t Position>
879 size_t index = Position >> etl::log2<Bits_Per_Element>::value;
880 element_type
bit = element_type(1) << (Position & (Bits_Per_Element - 1));
884 pbuffer[index] |=
bit;
888 pbuffer[index] &=
~bit;
895 template <
size_t Position,
bool Value>
898 size_t index = Position >> etl::log2<Bits_Per_Element>::value;
899 element_type
bit = element_type(1) << (Position & (Bits_Per_Element - 1));
903 pbuffer[index] |=
bit;
907 pbuffer[index] &=
~bit;
914 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t number_of_elements,
size_t total_bits,
const char* text) ETL_NOEXCEPT
916 if (text == ETL_NULLPTR)
918 etl::fill_n(pbuffer, number_of_elements, All_Clear_Element);
923 size_t index = etl::min(number_of_elements - 1U, (string_length / Bits_Per_Element));
926 while (index != number_of_elements)
928 pbuffer[index++] = All_Clear_Element;
932 size_t i = etl::min(total_bits, string_length);
944 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t number_of_elements,
size_t total_bits,
const wchar_t* text) ETL_NOEXCEPT
946 if (text == ETL_NULLPTR)
948 etl::fill_n(pbuffer, number_of_elements, All_Clear_Element);
953 size_t index = etl::min(number_of_elements - 1U, (string_length / Bits_Per_Element));
956 while (index != number_of_elements)
958 pbuffer[index++] = All_Clear_Element;
962 size_t i = etl::min(total_bits, string_length);
974 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t number_of_elements,
size_t total_bits,
const char16_t* text) ETL_NOEXCEPT
976 if (text == ETL_NULLPTR)
978 etl::fill_n(pbuffer, number_of_elements, All_Clear_Element);
983 size_t index = etl::min(number_of_elements - 1U, (string_length / Bits_Per_Element));
986 while (index != number_of_elements)
988 pbuffer[index++] = All_Clear_Element;
992 size_t i = etl::min(total_bits, string_length);
1004 static ETL_CONSTEXPR14
void from_string(pointer pbuffer,
size_t number_of_elements,
size_t total_bits,
const char32_t* text) ETL_NOEXCEPT
1006 if (text == ETL_NULLPTR)
1008 etl::fill_n(pbuffer, number_of_elements, All_Clear_Element);
1013 size_t index = etl::min(number_of_elements - 1U, (string_length / Bits_Per_Element));
1016 while (index != number_of_elements)
1018 pbuffer[index++] = All_Clear_Element;
1022 size_t i = etl::min(total_bits, string_length);
1034 static ETL_CONSTEXPR14
void reset_all(pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1036 while (number_of_elements-- != 0U)
1038 *pbuffer++ = All_Clear_Element;
1045 static ETL_CONSTEXPR14
void reset_position(pointer pbuffer,
size_t position) ETL_NOEXCEPT
1047 const size_t index = position >> etl::log2<Bits_Per_Element>::value;
1048 const element_type
bit = element_type(1) << (position & (Bits_Per_Element - 1));
1050 pbuffer[index] &=
~bit;
1056 template <
typename T>
1057 static ETL_CONSTEXPR14 T
value(const_pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1061 const bool OK = (
sizeof(T) * CHAR_BIT) >= (number_of_elements * Bits_Per_Element);
1065 uint_least8_t shift = 0U;
1067 for (
size_t i = 0UL; i < number_of_elements; ++i)
1069 v |= T(
typename etl::make_unsigned<T>::type(pbuffer[i]) << shift);
1070 shift += uint_least8_t(Bits_Per_Element);
1080 template <
typename T>
1082 size_t active_bits_in_msb,
size_t length) ETL_NOEXCEPT
1084 typedef typename etl::make_unsigned<T>::type unsigned_t;
1086 unsigned_t
value(0);
1089 if (active_bits_in_msb < Bits_Per_Element)
1091 element_type mask = etl::make_lsb_mask< element_type>(active_bits_in_msb);
1092 value = pbuffer[element_index] & mask;
1093 length -= active_bits_in_msb;
1094 if (length >= Bits_Per_Element)
1102 while (length >= Bits_Per_Element)
1104 value |= pbuffer[element_index];
1105 length -= Bits_Per_Element;
1106 if (length >= Bits_Per_Element)
1117 element_type mask = etl::make_lsb_mask< element_type>(length);
1118 value |= (pbuffer[element_index] >> (Bits_Per_Element - length)) & mask;
1128 template <
typename T>
1129 static ETL_CONSTEXPR14
typename etl::make_unsigned<T>::type
extract_from_buffer(const_pointer pbuffer,
size_t position,
size_t length)
1132 typedef typename etl::make_unsigned<T>::type unsigned_t;
1134 unsigned_t
value(0);
1136 const int Msb_Element_Index = (position + length - 1) >> etl::log2<Bits_Per_Element>::value;
1137 const int Lsb_Element_Index = position >> etl::log2<Bits_Per_Element>::value;
1140 if (Msb_Element_Index == Lsb_Element_Index)
1142 const unsigned_t Mask = etl::make_lsb_mask< unsigned_t>(length);
1143 const unsigned_t Shift = position % Bits_Per_Element;
1145 value =
static_cast<unsigned_t
>(pbuffer[Msb_Element_Index] >> Shift) & Mask;
1150 size_t active_bits_in_msb = (position + length) - (
static_cast<size_t>(Msb_Element_Index) * Bits_Per_Element);
1153 int element_index = Msb_Element_Index;
1165 template <
typename T,
size_t Position,
size_t Length>
1166 static ETL_CONSTEXPR14
1167 typename etl::enable_if< value_is_in_one_element<Position, Length, Bits_Per_Element>::value,
typename etl::make_unsigned<T>::type>
::type
1170 typedef typename etl::make_unsigned<T>::type unsigned_t;
1172 const int Element_Index = (Position + Length - 1) >> etl::log2<Bits_Per_Element>::value;
1173 const unsigned_t Mask = etl::lsb_mask<unsigned_t, Length>::value;
1174 const unsigned_t Shift = Position % Bits_Per_Element;
1176 return static_cast<unsigned_t
>(pbuffer[Element_Index] >> Shift) & Mask;
1183 template <
typename T,
size_t Position,
size_t Length>
1184 static ETL_CONSTEXPR14
1185 typename etl::enable_if< !value_is_in_one_element<Position, Length, Bits_Per_Element>::value,
typename etl::make_unsigned<T>::type>
::type
1189 const int Msb_Element_Index = (Position + Length - 1) >> etl::log2<Bits_Per_Element>::value;
1192 const size_t Active_Bits_In_Msb = ((Position + Length - 1) % Bits_Per_Element) + 1;
1200 template <
typename T>
1203 typedef typename etl::make_unsigned<T>::type unsigned_t;
1212 return static_cast<T
>(
value);
1218 template <
typename T,
size_t Position,
size_t Length>
1219 static ETL_CONSTEXPR14 T
extract(const_pointer pbuffer)
1221 typedef typename etl::make_unsigned<T>::type unsigned_t;
1230 return static_cast<T
>(
value);
1236 static ETL_CONSTEXPR14
void flip_all(pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1244 static ETL_CONSTEXPR14
void flip_position(pointer pbuffer,
size_t position) ETL_NOEXCEPT
1246 const size_t index = position >> etl::log2<Bits_Per_Element>::value;
1247 const element_type
bit = element_type(1) << (position & (Bits_Per_Element - 1));
1249 pbuffer[index] ^=
bit;
1258 static ETL_CONSTEXPR14
size_t find_next(const_pointer pbuffer,
size_t number_of_elements,
size_t total_bits,
bool state,
size_t position)
1262 size_t index = position >> log2<Bits_Per_Element>::value;
1263 size_t bit = position & (Bits_Per_Element - 1);
1265 element_type mask = 1 <<
bit;
1268 while (index < number_of_elements)
1270 element_type
value = pbuffer[index];
1273 if ((state && (
value != All_Clear_Element)) || (!state && (
value != All_Set_Element)))
1276 while ((
bit < Bits_Per_Element) && (position < total_bits))
1279 if (((
value & mask) != 0) == state)
1292 position += (Bits_Per_Element -
bit);
1308 template <
typename TString>
1309 static ETL_CONSTEXPR14 TString
to_string(const_pointer pbuffer,
size_t active_bits,
typename TString::value_type zero,
typename TString::value_type one)
1313 result.resize(active_bits,
'\0');
1318 for (
size_t i = active_bits; i > 0; --i)
1320 result[active_bits - i] =
test(pbuffer, i - 1) ? one : zero;
1329 static ETL_CONSTEXPR14
void operator_assignment(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1331 while (number_of_elements-- != 0)
1333 *lhs_pbuffer = *rhs_pbuffer;
1342 static ETL_CONSTEXPR14
void operator_and(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1344 while (number_of_elements-- != 0)
1346 *lhs_pbuffer &= *rhs_pbuffer;
1355 static ETL_CONSTEXPR14
void operator_or(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1357 while (number_of_elements-- != 0)
1359 *lhs_pbuffer |= *rhs_pbuffer;
1368 static ETL_CONSTEXPR14
void operator_xor(pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1370 while (number_of_elements-- != 0)
1372 *lhs_pbuffer ^= *rhs_pbuffer;
1381 static ETL_CONSTEXPR14
void operator_not(pointer pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1383 while (number_of_elements-- != 0)
1385 *pbuffer = ~*pbuffer;
1393 static ETL_CONSTEXPR14
void operator_shift_left(pointer pbuffer,
size_t number_of_elements,
size_t active_bits,
size_t shift) ETL_NOEXCEPT
1395 if (shift >= active_bits)
1402 const size_t split_position = Bits_Per_Element - (shift % Bits_Per_Element);
1405 int src_index = int(number_of_elements - (shift / Bits_Per_Element) - 1U);
1408 int dst_index = int(number_of_elements - 1U);
1411 const size_t lsb_shift = Bits_Per_Element - split_position;
1412 const size_t msb_shift = split_position;
1416 const element_type lsb_shifted_mask = element_type(
lsb_mask << lsb_shift);
1419 element_type lsb = element_type((pbuffer[src_index] &
lsb_mask) << lsb_shift);
1420 pbuffer[dst_index] = lsb;
1424 while (src_index >= 0)
1427 element_type msb = element_type((pbuffer[src_index] &
msb_mask) >> msb_shift);
1428 pbuffer[dst_index] = pbuffer[dst_index] | msb;
1432 lsb = element_type((pbuffer[src_index] &
lsb_mask) << lsb_shift);
1433 pbuffer[dst_index] = lsb;
1439 pbuffer[dst_index] &= lsb_shifted_mask;
1442 for (
int i = 0; i < dst_index; ++i)
1452 static ETL_CONSTEXPR14
void operator_shift_right(pointer pbuffer,
size_t number_of_elements,
size_t active_bits,
size_t shift) ETL_NOEXCEPT
1454 if (shift >= active_bits)
1461 const size_t split_position = shift % Bits_Per_Element;
1464 int src_index = int(shift / Bits_Per_Element);
1470 const size_t lsb_shift = Bits_Per_Element - split_position;
1471 const size_t msb_shift = split_position;
1475 const element_type msb_shifted_mask = element_type(
msb_mask >> msb_shift);
1478 while (src_index <
int(number_of_elements - 1))
1481 element_type msb = element_type((pbuffer[src_index] &
msb_mask) >> msb_shift);
1485 element_type lsb = element_type((pbuffer[src_index] &
lsb_mask) << lsb_shift);
1488 pbuffer[dst_index] = lsb | msb;
1493 element_type msb = element_type((pbuffer[src_index] &
msb_mask) >> msb_shift);
1494 pbuffer[dst_index] = msb;
1498 pbuffer[dst_index] &= msb_shifted_mask;
1502 while (dst_index <
int(number_of_elements))
1504 pbuffer[dst_index] = 0;
1513 static ETL_CONSTEXPR14
bool operator_equality(const_pointer lhs_pbuffer, const_pointer rhs_pbuffer,
size_t number_of_elements) ETL_NOEXCEPT
1515 return etl::equal(lhs_pbuffer, lhs_pbuffer + number_of_elements, rhs_pbuffer);
1523 template <
typename TElementType>
1526 initialise(pointer pbuffer,
size_t number_of_elements,
unsigned long long value) ETL_NOEXCEPT
1531 pbuffer[i++] =
value;
1534 while (i != number_of_elements)
1536 pbuffer[i++] = All_Clear_Element;
1545 template <
typename TElementType>
1548 initialise(pointer pbuffer,
size_t number_of_elements,
unsigned long long value) ETL_NOEXCEPT
1555 while ((
value != 0) && (i != number_of_elements))
1557 pbuffer[i++] =
value & All_Set_Element;
1562 while (i != number_of_elements)
1564 pbuffer[i++] = All_Clear_Element;
1571 static ETL_CONSTEXPR14
void swap(pointer pbuffer1, pointer pbuffer2,
size_t number_of_elements)
1573 etl::swap_ranges(pbuffer1, pbuffer1 + number_of_elements, pbuffer2);
1577 namespace private_bitset
1580 template <
size_t Active_Bits,
typename TElement>
1585 typedef typename etl::private_bitset::bitset_impl_common<TElement>::element_type element_type;
1591 static ETL_CONSTANT
size_t Number_Of_Elements =
1592 (Active_Bits % Bits_Per_Element == 0) ? Active_Bits / Bits_Per_Element : Active_Bits / Bits_Per_Element + 1;
1593 static ETL_CONSTANT
size_t Size = Active_Bits;
1594 static ETL_CONSTANT
size_t Allocated_Bits = Number_Of_Elements * Bits_Per_Element;
1598 (bitset_common<Active_Bits, TElement>::Number_Of_Elements == 1U) ? etl::bitset_storage_model::Single : etl::bitset_storage_model::Multi;
1608 static ETL_CONSTANT
size_t Top_Mask_Shift = ((Bits_Per_Element - ((Number_Of_Elements * Bits_Per_Element) - Active_Bits)) % Bits_Per_Element);
1612 static ETL_CONSTANT TElement Top_Mask = element_type(Top_Mask_Shift == 0 ? All_Set_Element : ~(All_Set_Element << Top_Mask_Shift));
1615 template <
size_t Active_Bits,
typename TElement>
1616 ETL_CONSTANT
size_t bitset_common<Active_Bits, TElement>::Number_Of_Elements;
1618 template <
size_t Active_Bits,
typename TElement>
1619 ETL_CONSTANT
size_t bitset_common<Active_Bits, TElement>::Size;
1622 template <
size_t Active_Bits,
typename TElement>
1625 template <
size_t Active_Bits,
typename TElement>
1627 (bitset_common<Active_Bits, TElement>::Number_Of_Elements == 1U) ? etl::bitset_storage_model::Single :
etl::
bitset_storage_model::Multi;
1630 template <
size_t Active_Bits,
typename TElement>
1631 ETL_CONSTANT
size_t bitset_common<Active_Bits, TElement>::Top_Mask_Shift;
1633 template <
size_t Active_Bits,
typename TElement>
1634 ETL_CONSTANT TElement bitset_common<Active_Bits, TElement>::Top_Mask;
1640 template <
size_t Active_Bits = 0U,
typename TElement =
unsigned char>
1651 typedef etl::private_bitset::bitset_common<0U, unsigned char>::element_type element_type;
1652 typedef etl::private_bitset::bitset_common<0U, unsigned char>::span_type span_type;
1653 typedef etl::private_bitset::bitset_common< 0U, unsigned char>::const_span_type const_span_type;
1668 template <
size_t Active_Bits,
typename TElement>
1673 ETL_STATIC_ASSERT(etl::is_unsigned<TElement>::value,
"The element type must be unsigned");
1675 typedef typename etl::private_bitset::bitset_common< Active_Bits, TElement>::element_type element_type;
1676 typedef typename etl::private_bitset::bitset_common< Active_Bits, TElement>::span_type span_type;
1677 typedef typename etl::private_bitset::bitset_common< Active_Bits, TElement>::const_span_type const_span_type;
1695 friend class bitset;
1701 : p_bitset(other.p_bitset)
1702 , position(other.position)
1709 ETL_CONSTEXPR14
operator bool() const ETL_NOEXCEPT
1711 return p_bitset->test(position);
1719 p_bitset->set(position, b);
1728 p_bitset->set(position,
bool(r));
1737 p_bitset->
flip(position);
1746 return !p_bitset->test(position);
1755 : p_bitset(ETL_NULLPTR)
1764 : p_bitset(&r_bitset)
1765 , position(position_)
1769 bitset<Active_Bits, TElement>* p_bitset;
1779 implementation::reset_all(buffer, Number_Of_Elements);
1788 implementation::operator_assignment(buffer, other.buffer, Number_Of_Elements);
1794 template <
typename TValue>
1795 ETL_CONSTEXPR14
bitset(TValue
value,
typename etl::enable_if<is_integral<TValue>::value>
::type* = 0) ETL_NOEXCEPT
1804 template <
typename TPString>
1805 ETL_CONSTEXPR14
bitset(TPString text,
typename etl::enable_if<is_same<TPString, const char*>::value>
::type* = 0) ETL_NOEXCEPT
1808 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1814 template <
typename TPString>
1815 ETL_CONSTEXPR14
bitset(TPString text,
typename etl::enable_if<is_same<TPString, const wchar_t*>::value>
::type* = 0) ETL_NOEXCEPT
1818 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1824 template <
typename TPString>
1825 ETL_CONSTEXPR14
bitset(TPString text,
typename etl::enable_if< is_same<TPString, const char16_t*>::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 char32_t*>::value>
::type* = 0) ETL_NOEXCEPT
1838 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1846 implementation::operator_assignment(buffer, other.buffer, Number_Of_Elements);
1856 implementation::set_all(buffer, Number_Of_Elements, Top_Mask);
1866 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
1868 implementation::set_position(buffer, position,
value);
1876 template <
size_t Position>
1879 ETL_STATIC_ASSERT(Position < Active_Bits,
"Position out of bounds");
1881 implementation::template set_position<Position>(buffer,
value);
1889 template <
size_t Position,
bool Value>
1892 ETL_STATIC_ASSERT(Position < Active_Bits,
"Position out of bounds");
1894 implementation::template set_position<Position, Value>(buffer);
1902 template <
typename TPString>
1906 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1914 template <
typename TPString>
1918 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1926 template <
typename TPString>
1930 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1938 template <
typename TPString>
1942 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
1952 implementation::from_string(buffer, Number_Of_Elements, Active_Bits, text);
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);
1990 template <
typename T>
1991 ETL_CONSTEXPR14
typename etl::enable_if<etl::is_integral<T>::value, T>
::type value() const ETL_NOEXCEPT
1993 ETL_STATIC_ASSERT(etl::is_integral<T>::value,
"Only integral types are supported");
1996 return implementation::template
value<T>(buffer, Number_Of_Elements);
2003 template <
typename T>
2006 ETL_STATIC_ASSERT(etl::is_integral<T>::value,
"Only integral types are supported");
2009 ETL_ASSERT_OR_RETURN_VALUE((position + length) <= Active_Bits, ETL_ERROR(
bitset_overflow), 0);
2011 return implementation::template
extract<T>(buffer, position, length);
2019 template <typename T, size_t Position, size_t Length = etl::integral_limits<T>::bits>
2021 template <
typename T,
size_t Position,
size_t Length>
2025 ETL_STATIC_ASSERT(etl::is_integral<T>::value,
"Only integral types are supported");
2027 ETL_STATIC_ASSERT((Position + Length) <= Active_Bits,
"Position/Length overflows bitset");
2057 implementation::reset_all(buffer, Number_Of_Elements);
2067 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
2069 implementation::reset_position(buffer, position);
2079 ETL_CONSTEXPR14
bool test(
size_t position)
const
2081 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow),
false);
2083 return implementation::test(buffer, position);
2090 template <
size_t Position>
2093 ETL_STATIC_ASSERT(Position < Active_Bits,
"Position out of bounds");
2095 return implementation::test(buffer, Position);
2101 static ETL_CONSTEXPR
size_t size() ETL_NOEXCEPT
2111 return Number_Of_Elements;
2119 return All_Set_Element;
2127 return All_Clear_Element;
2135 return Bits_Per_Element;
2141 static ETL_CONSTEXPR element_type
top_mask() ETL_NOEXCEPT
2151 return Number_Of_Elements * Bits_Per_Element;
2161 return Storage_Model;
2167 ETL_CONSTEXPR14
size_t count() const ETL_NOEXCEPT
2169 return implementation::count(buffer, Number_Of_Elements);
2175 ETL_CONSTEXPR14
bool all() const ETL_NOEXCEPT
2177 return implementation::all(buffer, Number_Of_Elements, Top_Mask);
2183 ETL_CONSTEXPR14
bool all(element_type mask)
const ETL_NOEXCEPT
2185 ETL_STATIC_ASSERT(Storage_Model == etl::bitset_storage_model::Single,
"Not supported for 'Multi' bitset storage model");
2187 return implementation::all(buffer, Number_Of_Elements, Top_Mask, mask);
2193 ETL_CONSTEXPR14
bool none() const ETL_NOEXCEPT
2195 return implementation::none(buffer, Number_Of_Elements);
2201 ETL_CONSTEXPR14
bool none(element_type mask)
const ETL_NOEXCEPT
2203 ETL_STATIC_ASSERT(Storage_Model == etl::bitset_storage_model::Single,
"Not supported for 'Multi' bitset storage model");
2205 return implementation::none(buffer, Number_Of_Elements, mask);
2211 ETL_CONSTEXPR14
bool any() const ETL_NOEXCEPT
2213 return implementation::any(buffer, Number_Of_Elements);
2219 ETL_CONSTEXPR14
bool any(element_type mask)
const ETL_NOEXCEPT
2221 ETL_STATIC_ASSERT(Storage_Model == etl::bitset_storage_model::Single,
"Not supported for 'Multi' bitset storage model");
2223 return implementation::any(buffer, Number_Of_Elements, mask);
2231 implementation::flip_all(buffer, Number_Of_Elements);
2241 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
2243 implementation::flip_position(buffer, position);
2251 ETL_CONSTEXPR14
bool operator[](
size_t position)
const ETL_NOEXCEPT
2253 return implementation::test(buffer, position);
2268 template <
typename TString = etl::
string<Active_Bits>>
2270 template <
typename TString>
2272 ETL_CONSTEXPR14 TString
to_string(
typename TString::value_type zero =
typename TString::value_type(
'0'),
2273 typename TString::value_type one =
typename TString::value_type(
'1'))
const
2285 return implementation::find_next(buffer, Number_Of_Elements, Active_Bits, state, 0);
2294 ETL_CONSTEXPR14
size_t find_next(
bool state,
size_t position)
const ETL_NOEXCEPT
2296 return implementation::find_next(buffer, Number_Of_Elements, Active_Bits, state, position);
2306 implementation::operator_and(temp.buffer, other.buffer, Number_Of_Elements);
2316 implementation::operator_and(buffer, other.buffer, Number_Of_Elements);
2328 implementation::operator_or(temp.buffer, other.buffer, Number_Of_Elements);
2338 implementation::operator_or(&buffer[0], &other.buffer[0], Number_Of_Elements);
2350 implementation::operator_xor(temp.buffer, other.buffer, Number_Of_Elements);
2360 implementation::operator_xor(buffer, other.buffer, Number_Of_Elements);
2372 implementation::flip_all(temp.buffer, Number_Of_Elements);
2384 implementation::operator_shift_left(temp.buffer, Number_Of_Elements, Active_Bits, shift);
2394 if (shift >= Active_Bits)
2396 implementation::reset_all(buffer, Number_Of_Elements);
2400 implementation::operator_shift_left(buffer, Number_Of_Elements, Active_Bits, shift);
2413 implementation::operator_shift_right(temp.buffer, Number_Of_Elements, Active_Bits, shift);
2423 if (shift >= Active_Bits)
2425 implementation::reset_all(buffer, Number_Of_Elements);
2429 implementation::operator_shift_right(buffer, Number_Of_Elements, Active_Bits, shift);
2440 return implementation::operator_equality(lhs.buffer, rhs.buffer, lhs.Number_Of_Elements);
2448 return !(lhs == rhs);
2456 implementation::swap(buffer, other.buffer, Number_Of_Elements);
2463 ETL_CONSTEXPR14 span_type
span() ETL_NOEXCEPT
2465 return span_type(buffer, Number_Of_Elements);
2472 ETL_CONSTEXPR14 const_span_type
span() const ETL_NOEXCEPT
2474 return const_span_type(buffer, Number_Of_Elements);
2484 element_type buffer[Number_Of_Elements];
2491 template <
size_t Active_Bits,
typename TElement>
2503 template <
size_t Active_Bits,
typename TElement>
2515 template <
size_t Active_Bits,
typename TElement>
2528template <
size_t Active_Bits,
typename TElement>
2531 return !(lhs == rhs);
2537template <
size_t Active_Bits,
typename TElement>
2549 template <
size_t Active_Bits = 0U,
typename TElement =
unsigned char>
2560 typedef size_t size_type;
2562 typedef etl::private_bitset::bitset_common<0U, unsigned char>::element_type element_type;
2563 typedef etl::private_bitset::bitset_common<0U, unsigned char>::span_type span_type;
2564 typedef etl::private_bitset::bitset_common< 0U, unsigned char>::const_span_type const_span_type;
2579 template <
size_t Active_Bits,
typename TElement>
2584 ETL_STATIC_ASSERT(etl::is_unsigned<TElement>::value,
"The element type must be unsigned");
2586 typedef size_t size_type;
2588 typedef typename etl::private_bitset::bitset_common< Active_Bits, TElement>::element_type element_type;
2589 typedef typename etl::private_bitset::bitset_common< Active_Bits, TElement>::span_type span_type;
2590 typedef typename etl::private_bitset::bitset_common< Active_Bits, TElement>::const_span_type const_span_type;
2610 friend class bitset_ext;
2616 : p_bitset(other.p_bitset)
2617 , position(other.position)
2624 ETL_CONSTEXPR14
operator bool() const ETL_NOEXCEPT
2626 return p_bitset->test(position);
2634 p_bitset->set(position, b);
2643 p_bitset->set(position,
bool(r));
2652 p_bitset->
flip(position);
2661 return !p_bitset->test(position);
2670 : p_bitset(ETL_NULLPTR)
2679 : p_bitset(&r_bitset)
2680 , position(position_)
2684 bitset_ext<Active_Bits, TElement>* p_bitset;
2695 implementation::reset_all(pbuffer, Number_Of_Elements);
2702 : pbuffer(buffer.
data())
2705 implementation::reset_all(pbuffer, Number_Of_Elements);
2715 implementation::operator_assignment(pbuffer, other.pbuffer, Number_Of_Elements);
2722 : pbuffer(buffer.data())
2724 implementation::operator_assignment(pbuffer, other.pbuffer, Number_Of_Elements);
2739 implementation::template initialise<element_type>(pbuffer, Number_Of_Elements,
value);
2745 template <
typename TValue>
2746 ETL_CONSTEXPR14
bitset_ext(TValue
value, buffer_type& buffer,
typename etl::enable_if<is_integral<TValue>::value>
::type* = 0) ETL_NOEXCEPT
2747 : pbuffer(buffer.
data())
2749 implementation::template initialise<element_type>(pbuffer, Number_Of_Elements,
static_cast<unsigned long long>(
value));
2755 template <
typename TPString>
2756 ETL_CONSTEXPR14
bitset_ext(TPString text, element_type* pbuffer_,
typename etl::enable_if<is_same<TPString, const char*>::value>
::type* = 0)
2760 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2766 template <
typename TPString>
2767 ETL_CONSTEXPR14
bitset_ext(TPString text, buffer_type& buffer,
typename etl::enable_if<is_same<TPString, const char*>::value>
::type* = 0)
2769 : pbuffer(buffer.
data())
2771 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2777 template <
typename TPString>
2778 ETL_CONSTEXPR14
bitset_ext(TPString text, element_type* pbuffer_,
typename etl::enable_if<is_same<TPString, const wchar_t*>::value>
::type* = 0)
2782 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2788 template <
typename TPString>
2789 ETL_CONSTEXPR14
bitset_ext(TPString text, buffer_type& buffer,
typename etl::enable_if<is_same<TPString, const wchar_t*>::value>
::type* = 0)
2791 : pbuffer(buffer.
data())
2793 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2799 template <
typename TPString>
2800 ETL_CONSTEXPR14
bitset_ext(TPString text, element_type* pbuffer_,
typename etl::enable_if< is_same<TPString, const char16_t*>::value>
::type* = 0)
2804 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2810 template <
typename TPString>
2811 ETL_CONSTEXPR14
bitset_ext(TPString text, buffer_type& buffer,
typename etl::enable_if< is_same<TPString, const char16_t*>::value>
::type* = 0)
2813 : pbuffer(buffer.
data())
2815 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2821 template <
typename TPString>
2822 ETL_CONSTEXPR14
bitset_ext(TPString text, element_type* pbuffer_,
typename etl::enable_if< is_same<TPString, const char32_t*>::value>
::type* = 0)
2826 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2832 template <
typename TPString>
2833 ETL_CONSTEXPR14
bitset_ext(TPString text, buffer_type& buffer,
typename etl::enable_if< is_same<TPString, const char32_t*>::value>
::type* = 0)
2835 : pbuffer(buffer.
data())
2837 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2845 implementation::operator_assignment(pbuffer, other.pbuffer, Number_Of_Elements);
2855 implementation::set_all(pbuffer, Number_Of_Elements, Top_Mask);
2865 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
2867 implementation::set_position(pbuffer, position,
value);
2875 template <
size_t Position>
2878 ETL_STATIC_ASSERT(Position < Active_Bits,
"Position out of bounds");
2880 implementation::template set_position<Position>(pbuffer,
value);
2888 template <
size_t Position,
bool Value>
2891 ETL_STATIC_ASSERT(Position < Active_Bits,
"Position out of bounds");
2893 implementation::template set_position<Position, Value>(pbuffer);
2901 template <
typename TPString>
2905 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2913 template <
typename TPString>
2915 set(TPString text) ETL_NOEXCEPT
2917 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2925 template <
typename TPString>
2927 set(TPString text) ETL_NOEXCEPT
2929 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2937 template <
typename TPString>
2939 set(TPString text) ETL_NOEXCEPT
2941 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2951 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2961 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2971 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2981 implementation::from_string(pbuffer, Number_Of_Elements, Active_Bits, text);
2989 template <
typename T>
2990 ETL_CONSTEXPR14 T
value() const ETL_NOEXCEPT
2992 ETL_STATIC_ASSERT(etl::is_integral<T>::value,
"Only integral types are supported");
2995 return implementation::template
value<T>(pbuffer, Number_Of_Elements);
3002 template <
typename T>
3005 ETL_STATIC_ASSERT(etl::is_integral<T>::value,
"Only integral types are supported");
3008 ETL_ASSERT_OR_RETURN_VALUE((position + length) <= Active_Bits, ETL_ERROR(
bitset_overflow), 0);
3010 return implementation::template
extract<T>(pbuffer, position, length);
3018 template <typename T, size_t Position, size_t Length = etl::integral_limits<T>::bits>
3020 template <
typename T,
size_t Position,
size_t Length>
3024 ETL_STATIC_ASSERT(etl::is_integral<T>::value,
"Only integral types are supported");
3026 ETL_STATIC_ASSERT((Position + Length) <= Active_Bits,
"Position/Length overflows bitset");
3056 implementation::reset_all(pbuffer, Number_Of_Elements);
3066 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
3068 implementation::reset_position(pbuffer, position);
3078 ETL_CONSTEXPR14
bool test(
size_t position)
const
3080 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow),
false);
3082 return implementation::test(pbuffer, position);
3089 template <
size_t Position>
3092 ETL_STATIC_ASSERT(Position < Active_Bits,
"Position out of bounds");
3094 return implementation::test(pbuffer, Position);
3100 static ETL_CONSTEXPR
size_t size() ETL_NOEXCEPT
3110 return Number_Of_Elements;
3118 return All_Set_Element;
3126 return All_Clear_Element;
3132 static ETL_CONSTEXPR element_type
top_mask() ETL_NOEXCEPT
3142 return Bits_Per_Element;
3150 return Number_Of_Elements * Bits_Per_Element;
3160 return Storage_Model;
3166 ETL_CONSTEXPR14
size_t count() const ETL_NOEXCEPT
3168 return implementation::count(pbuffer, Number_Of_Elements);
3174 ETL_CONSTEXPR14
bool all() const ETL_NOEXCEPT
3176 return implementation::all(pbuffer, Number_Of_Elements, Top_Mask);
3182 ETL_CONSTEXPR14
bool all(element_type mask)
const ETL_NOEXCEPT
3184 ETL_STATIC_ASSERT(Storage_Model == etl::bitset_storage_model::Single,
"Not supported for 'Multi' bitset storage model");
3186 return implementation::all(pbuffer, Number_Of_Elements, Top_Mask, mask);
3192 ETL_CONSTEXPR14
bool none() const ETL_NOEXCEPT
3194 return implementation::none(pbuffer, Number_Of_Elements);
3200 ETL_CONSTEXPR14
bool none(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::none(pbuffer, Number_Of_Elements, mask);
3210 ETL_CONSTEXPR14
bool any() const ETL_NOEXCEPT
3212 return implementation::any(pbuffer, Number_Of_Elements);
3218 ETL_CONSTEXPR14
bool any(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::any(pbuffer, Number_Of_Elements, mask);
3230 implementation::flip_all(pbuffer, Number_Of_Elements);
3240 ETL_ASSERT_OR_RETURN_VALUE(position < Active_Bits, ETL_ERROR(
bitset_overflow), *
this);
3242 implementation::flip_position(pbuffer, position);
3250 ETL_CONSTEXPR14
bool operator[](
size_t position)
const ETL_NOEXCEPT
3252 return implementation::test(pbuffer, position);
3267 template <
typename TString = etl::
string<Active_Bits>>
3269 template <
typename TString>
3271 ETL_CONSTEXPR14 TString
to_string(
typename TString::value_type zero =
typename TString::value_type(
'0'),
3272 typename TString::value_type one =
typename TString::value_type(
'1'))
const
3284 return implementation::find_next(pbuffer, Number_Of_Elements, Active_Bits, state, 0);
3293 ETL_CONSTEXPR14
size_t find_next(
bool state,
size_t position)
const ETL_NOEXCEPT
3295 return implementation::find_next(pbuffer, Number_Of_Elements, Active_Bits, state, position);
3303 implementation::operator_and(&pbuffer[0], &other.pbuffer[0], Number_Of_Elements);
3313 implementation::operator_or(&pbuffer[0], &other.pbuffer[0], Number_Of_Elements);
3323 implementation::operator_xor(&pbuffer[0], &other.pbuffer[0], Number_Of_Elements);
3333 implementation::operator_shift_left(pbuffer, Number_Of_Elements, Active_Bits, shift);
3343 implementation::operator_shift_right(pbuffer, Number_Of_Elements, Active_Bits, shift);
3353 return implementation::operator_equality(lhs.pbuffer, rhs.pbuffer, lhs.Number_Of_Elements);
3361 return !(lhs == rhs);
3369 implementation::swap(pbuffer, other.pbuffer, Number_Of_Elements);
3376 ETL_CONSTEXPR14 span_type
span() ETL_NOEXCEPT
3378 return span_type(pbuffer, Number_Of_Elements);
3385 ETL_CONSTEXPR14 const_span_type
span() const ETL_NOEXCEPT
3387 return const_span_type(pbuffer, Number_Of_Elements);
3397 element_type* pbuffer;
3405template <
size_t Active_Bits,
typename TElement>
3408 return !(lhs == rhs);
3414template <
size_t Active_Bits,
typename TElement>
3422 namespace private_bitset
3428 template <
typename TLhsSpan,
typename TRhsSpan>
3431 typedef typename TLhsSpan::value_type lhs_element_t;
3432 typedef typename TRhsSpan::value_type rhs_element_t;
3434 const int steps =
static_cast<int>(
sizeof(lhs_element_t) /
sizeof(rhs_element_t));
3436 typename TLhsSpan::iterator lhs_itr = lhs_span.begin();
3437 typename TRhsSpan::iterator rhs_itr = rhs_span.begin();
3439 while (lhs_itr != lhs_span.end())
3441 const lhs_element_t& lhs_value = *lhs_itr;
3444 lhs_element_t rhs_value = 0;
3449 for (
int i = 0; i < steps; ++i)
3451 rhs_value |= (
static_cast<lhs_element_t
>(*rhs_itr) << shift);
3453 shift += shift_step;
3456 if (lhs_value != rhs_value)
3475template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3476ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3480 typename etl::bitset<Active_Bits, TLhsElement>::const_span_type lhs_span = lhs.span();
3481 typename etl::bitset<Active_Bits, TRhsElement>::const_span_type rhs_span = rhs.span();
3484 if ETL_IF_CONSTEXPR (
sizeof(TLhsElement) >
sizeof(TRhsElement))
3500template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3501ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3504 return !(lhs == rhs);
3513template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3514ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3518 typename etl::bitset_ext<Active_Bits, TLhsElement>::const_span_type lhs_span = lhs.span();
3519 typename etl::bitset_ext<Active_Bits, TRhsElement>::const_span_type rhs_span = rhs.span();
3522 if ETL_IF_CONSTEXPR (
sizeof(TLhsElement) >
sizeof(TRhsElement))
3538template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3539ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3542 return !(lhs == rhs);
3550template <
size_t Active_Bits,
typename TElement>
3553 const char Storage_Model = etl::bitset<Active_Bits, TElement>::Storage_Model;
3554 const size_t Number_Of_Elements = etl::bitset<Active_Bits, TElement>::Number_Of_Elements;
3556 typename etl::bitset<Active_Bits, TElement>::const_span_type lhs_span = lhs.span();
3557 typename etl::bitset_ext<Active_Bits, TElement>::const_span_type rhs_span = rhs.span();
3561 return implementation::operator_equality(lhs_span.
begin(), rhs_span.
begin(), Number_Of_Elements);
3569template <
size_t Active_Bits,
typename TElement>
3572 return !(lhs == rhs);
3580template <
size_t Active_Bits,
typename TElement>
3583 const char Storage_Model = etl::bitset<Active_Bits, TElement>::Storage_Model;
3584 const size_t Number_Of_Elements = etl::bitset<Active_Bits, TElement>::Number_Of_Elements;
3586 typename etl::bitset_ext<Active_Bits, TElement>::const_span_type lhs_span = lhs.span();
3587 typename etl::bitset<Active_Bits, TElement>::const_span_type rhs_span = rhs.span();
3591 return implementation::operator_equality(lhs_span.
begin(), rhs_span.
begin(), Number_Of_Elements);
3599template <
size_t Active_Bits,
typename TElement>
3602 return !(lhs == rhs);
3610template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3611ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3615 typename etl::bitset<Active_Bits, TLhsElement>::const_span_type lhs_span = lhs.span();
3616 typename etl::bitset_ext<Active_Bits, TRhsElement>::const_span_type rhs_span = rhs.span();
3619 if ETL_IF_CONSTEXPR (
sizeof(TLhsElement) >
sizeof(TRhsElement))
3634template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3635ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3638 return !(lhs == rhs);
3646template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3647ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3651 typename etl::bitset_ext<Active_Bits, TLhsElement>::const_span_type lhs_span = lhs.span();
3652 typename etl::bitset<Active_Bits, TRhsElement>::const_span_type rhs_span = rhs.span();
3655 if ETL_IF_CONSTEXPR (
sizeof(TLhsElement) >
sizeof(TRhsElement))
3670template <
size_t Active_Bits,
typename TLhsElement,
typename TRhsElement>
3671ETL_CONSTEXPR14
typename etl::enable_if<!etl::is_same<TLhsElement, TRhsElement>::value,
bool>
::type
3674 return !(lhs == rhs);
ETL_CONSTEXPR14 void swap(etl::bitset< Active_Bits, TElement > &lhs, etl::bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
swap
Definition bitset_new.h:2538
bool compare_bitset_spans(const TLhsSpan &lhs_span, const TRhsSpan &rhs_span)
Definition bitset_new.h:3429
The reference type returned.
Definition bitset_new.h:1692
ETL_CONSTEXPR14 bit_reference(const bit_reference &other) ETL_NOEXCEPT
Copy constructor.
Definition bitset_new.h:1700
ETL_CONSTEXPR14 bit_reference & operator=(const bit_reference &r) ETL_NOEXCEPT
Assignment operator.
Definition bitset_new.h:1726
ETL_CONSTEXPR14 bit_reference & operator=(bool b) ETL_NOEXCEPT
Assignment operator.
Definition bitset_new.h:1717
ETL_CONSTEXPR14 bit_reference & flip() ETL_NOEXCEPT
Flip the bit.
Definition bitset_new.h:1735
ETL_CONSTEXPR14 bool operator~() const ETL_NOEXCEPT
Return the logical inverse of the bit.
Definition bitset_new.h:1744
The reference type returned.
Definition bitset_new.h:2607
ETL_CONSTEXPR14 bit_reference & operator=(bool b) ETL_NOEXCEPT
Assignment operator.
Definition bitset_new.h:2632
ETL_CONSTEXPR14 bit_reference & operator=(const bit_reference &r) ETL_NOEXCEPT
Assignment operator.
Definition bitset_new.h:2641
ETL_CONSTEXPR14 bit_reference & flip() ETL_NOEXCEPT
Flip the bit.
Definition bitset_new.h:2650
ETL_CONSTEXPR14 bool operator~() const ETL_NOEXCEPT
Return the logical inverse of the bit.
Definition bitset_new.h:2659
ETL_CONSTEXPR14 bit_reference(const bit_reference &other) ETL_NOEXCEPT
Copy constructor.
Definition bitset_new.h:2615
A bitset that uses externally declared storage.
Definition bitset_new.h:2581
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:2939
ETL_CONSTEXPR14 T extract() const
Definition bitset_new.h:3022
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:2915
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & from_string(const char32_t *text) ETL_NOEXCEPT
Set from a u32 string.
Definition bitset_new.h:2979
ETL_CONSTEXPR14 bitset_ext & operator=(const bitset_ext< Active_Bits, TElement > &other) ETL_NOEXCEPT
Assignment operator.
Definition bitset_new.h:2843
ETL_CONSTEXPR14 bool any() const ETL_NOEXCEPT
Are any of the bits set?
Definition bitset_new.h:3210
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:2811
static ETL_CONSTEXPR element_type all_set_element() ETL_NOEXCEPT
The value of a set element.
Definition bitset_new.h:3116
ETL_CONSTEXPR14 void swap(etl::bitset_ext< Active_Bits, TElement > &other) ETL_NOEXCEPT
swap
Definition bitset_new.h:3367
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:3351
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & flip(size_t position)
Flip the bit at the position.
Definition bitset_new.h:3238
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & from_string(const char *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:2949
ETL_CONSTEXPR14 size_t find_next(bool state, size_t position) const ETL_NOEXCEPT
Definition bitset_new.h:3293
static ETL_CONSTEXPR element_type top_mask() ETL_NOEXCEPT
The mask for the msb element.
Definition bitset_new.h:3132
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:2756
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:2746
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:2800
unsigned long long to_ullong() const
Get as an unsigned long long.
Definition bitset_new.h:3044
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & operator<<=(size_t shift) ETL_NOEXCEPT
operator <<=
Definition bitset_new.h:3331
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & operator|=(const bitset_ext< Active_Bits, TElement > &other) ETL_NOEXCEPT
operator |=
Definition bitset_new.h:3311
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & operator^=(const bitset_ext< Active_Bits, TElement > &other) ETL_NOEXCEPT
operator ^=
Definition bitset_new.h:3321
ETL_CONSTEXPR14 bool any(element_type mask) const ETL_NOEXCEPT
Are any of the mask bits set?
Definition bitset_new.h:3218
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & reset() ETL_NOEXCEPT
Reset all of the bits.
Definition bitset_new.h:3054
ETL_CONSTEXPR14 bool none() const ETL_NOEXCEPT
Are none of the bits set?
Definition bitset_new.h:3192
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & set() ETL_NOEXCEPT
Set all of the bits.
Definition bitset_new.h:2853
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & reset(size_t position)
Reset the bit at the position.
Definition bitset_new.h:3064
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:2789
ETL_CONSTEXPR14 bitset_ext(element_type *pbuffer_)
Definition bitset_new.h:2691
ETL_CONSTEXPR14 T value() const ETL_NOEXCEPT
Get as an integral value.
Definition bitset_new.h:2990
ETL_CONSTEXPR14 bitset_ext(unsigned long long value, element_type *pbuffer_)
Construct from a value.
Definition bitset_new.h:2735
static ETL_CONSTEXPR size_t bits_per_element() ETL_NOEXCEPT
The number of bits in an element.
Definition bitset_new.h:3140
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:2822
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:2902
ETL_CONSTEXPR14 bool operator[](size_t position) const ETL_NOEXCEPT
Read [] operator.
Definition bitset_new.h:3250
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & operator&=(const bitset_ext< Active_Bits, TElement > &other) ETL_NOEXCEPT
operator &=
Definition bitset_new.h:3301
static ETL_CONSTEXPR size_t size() ETL_NOEXCEPT
The number of bits in the bitset.
Definition bitset_new.h:3100
static ETL_CONSTEXPR size_t number_of_elements() ETL_NOEXCEPT
The number of storage elements in the bitset.
Definition bitset_new.h:3108
ETL_CONSTEXPR14 bool test(size_t position) const
Definition bitset_new.h:3078
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & flip() ETL_NOEXCEPT
Flip all of the bits.
Definition bitset_new.h:3228
static ETL_CONSTEXPR size_t allocated_bits() ETL_NOEXCEPT
The total number of bits of storage, including unused.
Definition bitset_new.h:3148
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & set(size_t position, bool value=true)
Set the bit at the position.
Definition bitset_new.h:2863
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:2778
unsigned long to_ulong() const
Get as an unsigned long.
Definition bitset_new.h:3034
ETL_CONSTEXPR14 bool test() const
Definition bitset_new.h:3090
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:2833
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:2927
ETL_CONSTEXPR14 bit_reference operator[](size_t position) ETL_NOEXCEPT
Write [] operator.
Definition bitset_new.h:3258
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & from_string(const wchar_t *text) ETL_NOEXCEPT
Set from a wide string.
Definition bitset_new.h:2959
ETL_CONSTEXPR14 bool none(element_type mask) const ETL_NOEXCEPT
Are none of the mask bits set?
Definition bitset_new.h:3200
ETL_CONSTEXPR14 size_t count() const ETL_NOEXCEPT
Count the number of bits set.
Definition bitset_new.h:3166
ETL_CONSTEXPR14 bitset_ext(const bitset_ext< Active_Bits, TElement > &other, buffer_type &buffer) ETL_NOEXCEPT
Construct copy.
Definition bitset_new.h:2721
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & set()
Set the bit at the position.
Definition bitset_new.h:2889
ETL_CONSTEXPR14 bitset_ext(const bitset_ext< Active_Bits, TElement > &other, element_type *pbuffer_)
Construct copy.
Definition bitset_new.h:2711
static ETL_CONSTEXPR etl::bitset_storage_model storage_model() ETL_NOEXCEPT
Definition bitset_new.h:3158
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & operator>>=(size_t shift) ETL_NOEXCEPT
operator >>=
Definition bitset_new.h:3341
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:3359
ETL_CONSTEXPR14 size_t find_first(bool state) const ETL_NOEXCEPT
Definition bitset_new.h:3282
static ETL_CONSTEXPR element_type all_clear_element() ETL_NOEXCEPT
The value of a clear element.
Definition bitset_new.h:3124
ETL_CONSTEXPR14 const_span_type span() const ETL_NOEXCEPT
Definition bitset_new.h:3385
ETL_CONSTEXPR14 bitset_ext< Active_Bits, TElement > & set(bool value=true)
Set the bit at the position.
Definition bitset_new.h:2876
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:2767
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:3271
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:2969
ETL_CONSTEXPR14 bitset_ext(buffer_type &buffer)
Default constructor.
Definition bitset_new.h:2701
ETL_CONSTEXPR14 span_type span() ETL_NOEXCEPT
Definition bitset_new.h:3376
ETL_CONSTEXPR14 T extract(size_t position, size_t length=etl::integral_limits< T >::bits)
Definition bitset_new.h:3003
Definition bitset_new.h:1582
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
#define ETL_DECLARE_ENUM_TYPE(TypeName, ValueType)
Definition enum_type.h:90
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:1513
static ETL_CONSTEXPR14 etl::make_unsigned< T >::type extract_from_multiple_elements(const element_type *pbuffer, int element_index, size_t active_bits_in_msb, size_t length) ETL_NOEXCEPT
Extract an value from multiple elements.
Definition bitset_new.h:1081
ETL_CONSTEXPR14 bool none(element_type mask) const ETL_NOEXCEPT
Are none of the mask bits set?
Definition bitset_new.h:2201
static ETL_CONSTEXPR14 T extract(const_pointer pbuffer)
Extract an integral value from an arbitrary position and length.
Definition bitset_new.h:1219
ETL_CONSTEXPR14 size_t find_next(bool state, size_t position) const ETL_NOEXCEPT
Definition bitset_new.h:2294
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:1258
ETL_CONSTEXPR14 T extract(size_t position, size_t length=etl::integral_limits< T >::bits) const
Definition bitset_new.h:2004
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:845
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & set(size_t position, bool value=true)
Set the bit at the position.
Definition bitset_new.h:1864
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:1168
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:1129
ETL_CONSTEXPR14 bitset(const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
Copy constructor.
Definition bitset_new.h:1785
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:715
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:1927
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:537
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:1186
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:529
static ETL_CONSTEXPR element_type all_set_element() ETL_NOEXCEPT
The value of a set element.
Definition bitset_new.h:2117
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:1980
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:914
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator&=(const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
operator &=
Definition bitset_new.h:2314
static ETL_CONSTEXPR14 T extract(const_pointer pbuffer)
Extract an integral value from an arbitrary position and length.
Definition bitset_new.h:450
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator>>=(size_t shift) ETL_NOEXCEPT
operator >>=
Definition bitset_new.h:2421
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & from_string(const char16_t *text) ETL_NOEXCEPT
Set from a u16 string.
Definition bitset_new.h:1970
static ETL_CONSTEXPR14 void flip_all(pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
Flip all of the bits.
Definition bitset_new.h:1236
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & set() ETL_NOEXCEPT
Set all of the bits.
Definition bitset_new.h:1854
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:588
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:707
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator>>(size_t shift) const ETL_NOEXCEPT
operator >>
Definition bitset_new.h:2409
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator<<(size_t shift) const ETL_NOEXCEPT
operator <<
Definition bitset_new.h:2380
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:1309
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator~() const ETL_NOEXCEPT
operator ~
Definition bitset_new.h:2368
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & flip() ETL_NOEXCEPT
Flip all of the bits.
Definition bitset_new.h:2229
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & from_string(const char *text) ETL_NOEXCEPT
Set from a string.
Definition bitset_new.h:1950
ETL_CONSTEXPR14 const_span_type span() const ETL_NOEXCEPT
Definition bitset_new.h:2472
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:944
ETL_CONSTEXPR14 bool none() const ETL_NOEXCEPT
Are none of the bits set?
Definition bitset_new.h:2193
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:1825
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator<<=(size_t shift) ETL_NOEXCEPT
operator <<=
Definition bitset_new.h:2392
static ETL_CONSTEXPR14 void flip_position(pointer pbuffer, size_t position)
Flip the bit at the position.
Definition bitset_new.h:553
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:974
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator&(const bitset< Active_Bits, TElement > &other) const ETL_NOEXCEPT
operator &
Definition bitset_new.h:2302
ETL_CONSTEXPR14 bit_reference operator[](size_t position) ETL_NOEXCEPT
Write [] operator.
Definition bitset_new.h:2259
static ETL_CONSTEXPR14 void set_position(pointer pbuffer, bool value=true)
Set the bit at the position.
Definition bitset_new.h:877
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:1329
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:513
ETL_CONSTEXPR14 size_t find_first(bool state) const ETL_NOEXCEPT
Definition bitset_new.h:2283
static ETL_CONSTEXPR14 void set_position(pointer pbuffer)
Set the bit at the position.
Definition bitset_new.h:896
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:1795
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & from_string(const wchar_t *text) ETL_NOEXCEPT
Set from a wide string.
Definition bitset_new.h:1960
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:1342
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & flip(size_t position)
Flip the bit at the position.
Definition bitset_new.h:2239
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:2109
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:772
static ETL_CONSTEXPR14 void operator_or(pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
Definition bitset_new.h:642
ETL_CONSTEXPR14 void swap(etl::bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
swap
Definition bitset_new.h:2454
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:1201
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:2272
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:331
static ETL_CONSTEXPR size_t allocated_bits() ETL_NOEXCEPT
The total number of bits of storage, including unused.
Definition bitset_new.h:2149
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:1393
static ETL_CONSTEXPR element_type top_mask() ETL_NOEXCEPT
The mask for the msb element.
Definition bitset_new.h:2141
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:1355
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:683
ETL_CONSTEXPR14 bool test(size_t position) const
Definition bitset_new.h:2079
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:1991
static ETL_CONSTEXPR14 bool any(const_pointer pbuffer, size_t) ETL_NOEXCEPT
Are any of the bits set?
Definition bitset_new.h:521
ETL_CONSTEXPR14 bool any(element_type mask) const ETL_NOEXCEPT
Are any of the mask bits set?
Definition bitset_new.h:2219
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator^=(const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
operator ^=
Definition bitset_new.h:2358
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:1835
static ETL_CONSTEXPR element_type all_clear_element() ETL_NOEXCEPT
The value of a clear element.
Definition bitset_new.h:2125
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & reset() ETL_NOEXCEPT
Reset all of the bits.
Definition bitset_new.h:2055
static ETL_CONSTEXPR14 void reset_all(pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
Reset all of the bits.
Definition bitset_new.h:1034
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:668
static ETL_CONSTEXPR14 void operator_xor(pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
Definition bitset_new.h:651
static ETL_CONSTEXPR14 T value(const_pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
Get as a value.
Definition bitset_new.h:1057
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:545
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:810
static ETL_CONSTEXPR14 void flip_position(pointer pbuffer, size_t position) ETL_NOEXCEPT
Flip the bit at the position.
Definition bitset_new.h:1244
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator|(const bitset< Active_Bits, TElement > &other) const ETL_NOEXCEPT
operator |
Definition bitset_new.h:2324
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:858
static ETL_CONSTEXPR14 void swap(pointer pbuffer1, pointer pbuffer2, size_t number_of_elements)
Swap bitset buffers.
Definition bitset_new.h:1571
static ETL_CONSTEXPR14 void operator_not(pointer pbuffer, size_t number_of_elements) ETL_NOEXCEPT
operator not
Definition bitset_new.h:1381
ETL_CONSTEXPR14 bitset & operator=(const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
Assignment operator.
Definition bitset_new.h:1844
static ETL_CONSTEXPR size_t bits_per_element() ETL_NOEXCEPT
The number of bits in an element.
Definition bitset_new.h:2133
ETL_CONSTEXPR14 size_t count() const ETL_NOEXCEPT
Count the number of bits set.
Definition bitset_new.h:2167
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:1526
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:416
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & set(bool value=true)
Set the bit at the position.
Definition bitset_new.h:1877
ETL_CONSTEXPR14 bool operator[](size_t position) const ETL_NOEXCEPT
Read [] operator.
Definition bitset_new.h:2251
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:1815
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:1903
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:826
static ETL_CONSTEXPR14 bool test(const_pointer pbuffer, size_t position)
Definition bitset_new.h:472
static ETL_CONSTEXPR14 void reset_position(pointer pbuffer, size_t position) ETL_NOEXCEPT
Reset the bit at the position.
Definition bitset_new.h:1045
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > operator^(const bitset< Active_Bits, TElement > &other) const ETL_NOEXCEPT
operator ^
Definition bitset_new.h:2346
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:505
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:1004
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & reset(size_t position)
Reset the bit at the position.
Definition bitset_new.h:2065
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:1915
static ETL_CONSTEXPR size_t size() ETL_NOEXCEPT
The number of bits in the bitset.
Definition bitset_new.h:2101
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:1805
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:387
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:1452
static ETL_CONSTEXPR14 void operator_and(pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
Definition bitset_new.h:633
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:1890
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:425
unsigned long long to_ullong() const
Get as an unsigned long long.
Definition bitset_new.h:2045
ETL_CONSTEXPR14 bool any() const ETL_NOEXCEPT
Are any of the bits set?
Definition bitset_new.h:2211
static ETL_CONSTEXPR14 bool operator_equality(const_pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
operator_equality
Definition bitset_new.h:698
ETL_CONSTEXPR14 bool test() const
Definition bitset_new.h:2091
ETL_CONSTEXPR14 span_type span() ETL_NOEXCEPT
Definition bitset_new.h:2463
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:359
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:2035
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:1368
friend ETL_CONSTEXPR14 bool operator==(const bitset< Active_Bits, TElement > &lhs, const bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
operator ==
Definition bitset_new.h:2438
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:1548
static ETL_CONSTEXPR14 size_t count(const_pointer pbuffer, size_t) ETL_NOEXCEPT
Count the number of bits set.
Definition bitset_new.h:481
static ETL_CONSTEXPR14 void operator_assignment(pointer lhs_pbuffer, const_pointer rhs_pbuffer, size_t) ETL_NOEXCEPT
Definition bitset_new.h:624
static ETL_CONSTEXPR14 bool test(const_pointer pbuffer, size_t position) ETL_NOEXCEPT
Definition bitset_new.h:761
ETL_CONSTEXPR14 T extract() const
Definition bitset_new.h:2023
static ETL_CONSTEXPR14 void operator_not(pointer pbuffer, size_t) ETL_NOEXCEPT
Definition bitset_new.h:660
ETL_CONSTEXPR14 bitset< Active_Bits, TElement > & operator|=(const bitset< Active_Bits, TElement > &other) ETL_NOEXCEPT
operator |=
Definition bitset_new.h:2336
friend ETL_CONSTEXPR14 bool operator!=(const bitset< Active_Bits, TElement > &lhs, const bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
operator !=
Definition bitset_new.h:2446
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:563
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:1939
ETL_CONSTEXPR14 bitset() ETL_NOEXCEPT
Default constructor.
Definition bitset_new.h:1776
static ETL_CONSTEXPR etl::bitset_storage_model storage_model() ETL_NOEXCEPT
Definition bitset_new.h:2159
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
ETL_CONSTEXPR14 etl::enable_if<!etl::is_same< TLhsElement, TRhsElement >::value, bool >::type operator==(const etl::bitset< Active_Bits, TLhsElement > &lhs, const etl::bitset< Active_Bits, TRhsElement > &rhs) ETL_NOEXCEPT
Definition bitset_new.h:3477
ETL_CONSTEXPR14 bool operator!=(const etl::bitset< Active_Bits, TElement > &lhs, const etl::bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
Definition bitset_new.h:2529
Definition bitset_new.h:90
#define ETL_ASSERT(b, e)
Definition error_handler.h:511
Definition exception.h:59
Definition integral_limits.h:518
bitset_ext
Definition absolute.h:40
ETL_CONSTEXPR TContainer::pointer data(TContainer &container)
Definition iterator.h:1228
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::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:751