diff options
author | tobo <tobo@yandex-team.com> | 2024-10-22 22:48:54 +0300 |
---|---|---|
committer | tobo <tobo@yandex-team.com> | 2024-10-22 23:06:25 +0300 |
commit | a76b79c4e2cd66be012c9e74367aac5e4070b709 (patch) | |
tree | 40b178449181642bf2cc23a7322ea58e9341826c /library/cpp/containers/bitseq/bititerator.h | |
parent | b96dac434453917b81db6116596ff45e7748553a (diff) | |
download | ydb-a76b79c4e2cd66be012c9e74367aac5e4070b709.tar.gz |
PopCount => std::popcount
commit_hash:b648a03fff23eec34a775607e9435d77a885a27a
Diffstat (limited to 'library/cpp/containers/bitseq/bititerator.h')
-rw-r--r-- | library/cpp/containers/bitseq/bititerator.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/cpp/containers/bitseq/bititerator.h b/library/cpp/containers/bitseq/bititerator.h index efe7ba873b..cc18af572f 100644 --- a/library/cpp/containers/bitseq/bititerator.h +++ b/library/cpp/containers/bitseq/bititerator.h @@ -1,8 +1,8 @@ #pragma once #include "traits.h" +#include <bit> -#include <library/cpp/pop_count/popcount.h> template <typename T> class TBitIterator { @@ -49,7 +49,7 @@ public: if (!Mask) return *Data & TTraits::ElemMask(count); - auto usedBits = (size_t)PopCount(Mask - 1); + auto usedBits = (size_t)std::popcount(Mask - 1u); TWord result = Current >> usedBits; auto leftInCurrent = TTraits::NumBits - usedBits; if (count <= leftInCurrent) @@ -72,7 +72,7 @@ public: return Current & TTraits::ElemMask(count); } - auto usedBits = (size_t)PopCount(Mask - 1); + auto usedBits = (size_t)std::popcount(Mask - 1u); TWord result = Current >> usedBits; auto leftInCurrent = TTraits::NumBits - usedBits; if (count < leftInCurrent) { @@ -97,7 +97,7 @@ public: if (!count) return; - int leftInCurrent = (size_t)PopCount(~(Mask - 1)); + int leftInCurrent = std::popcount(static_cast<TWord>(~(Mask - 1u))); if (count < leftInCurrent) { Mask <<= count; return; |