| 386 | |
| 387 | template<class TChar = char, class TTraits = std::char_traits<TChar>, class TAlloc = std::allocator<TChar>> |
| 388 | std::basic_string<TChar, TTraits, TAlloc> to_string(TChar zero = TChar{ '0' }, TChar one = TChar{ '1' }) const |
| 389 | { |
| 390 | std::basic_string<TChar, TTraits, TAlloc> res; |
| 391 | res.resize(TBitSize); |
| 392 | for (size_t i = 0; i < TBitSize; ++i) |
| 393 | { |
| 394 | // Printed as little-endian. |
| 395 | res[TBitSize - i - 1] = get(i) ? one : zero; |
| 396 | } |
| 397 | return res; |
| 398 | } |
| 399 | |
| 400 | constexpr BitSet operator^(const BitSet& other) const noexcept |
| 401 | { |