diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2022-12-29 10:12:22 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2022-12-29 10:12:22 +0300 |
commit | 05444d93a739253c1f9568931ffb94daa3527805 (patch) | |
tree | d95dc84248e98ca8d91663a9bf8cbb25147f1641 /contrib | |
parent | d35573bf04bca41822f34f34cb7f8204aadd9e47 (diff) | |
download | ydb-05444d93a739253c1f9568931ffb94daa3527805.tar.gz |
Update contrib/restricted/boost/dynamic_bitset to 1.81.0
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/restricted/boost/dynamic_bitset/include/boost/dynamic_bitset/dynamic_bitset.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/contrib/restricted/boost/dynamic_bitset/include/boost/dynamic_bitset/dynamic_bitset.hpp b/contrib/restricted/boost/dynamic_bitset/include/boost/dynamic_bitset/dynamic_bitset.hpp index 7c96f0905e..a2abfc9329 100644 --- a/contrib/restricted/boost/dynamic_bitset/include/boost/dynamic_bitset/dynamic_bitset.hpp +++ b/contrib/restricted/boost/dynamic_bitset/include/boost/dynamic_bitset/dynamic_bitset.hpp @@ -293,6 +293,8 @@ public: dynamic_bitset& flip(size_type n, size_type len); dynamic_bitset& flip(size_type n); dynamic_bitset& flip(); + reference at(size_type n); + bool at(size_type n) const; bool test(size_type n) const; bool test_set(size_type n, bool val = true); bool all() const; @@ -1115,6 +1117,25 @@ bool dynamic_bitset<Block, Allocator>::m_unchecked_test(size_type pos) const } template <typename Block, typename Allocator> +typename dynamic_bitset<Block, Allocator>::reference +dynamic_bitset<Block, Allocator>::at(size_type pos) +{ + if (pos >= m_num_bits) + BOOST_THROW_EXCEPTION(std::out_of_range("boost::dynamic_bitset::at out_of_range")); + + return (*this)[pos]; +} + +template <typename Block, typename Allocator> +bool dynamic_bitset<Block, Allocator>::at(size_type pos) const +{ + if (pos >= m_num_bits) + BOOST_THROW_EXCEPTION(std::out_of_range("boost::dynamic_bitset::at out_of_range")); + + return (*this)[pos]; +} + +template <typename Block, typename Allocator> bool dynamic_bitset<Block, Allocator>::test(size_type pos) const { assert(pos < m_num_bits); |