Skip to content

Commit ff35b23

Browse files
committed
add docs
1 parent af248fb commit ff35b23

File tree

4 files changed

+113
-8
lines changed

4 files changed

+113
-8
lines changed

dynamic_bitset.html

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,29 @@ <h3><a id ="synopsis">Synopsis</a></h3>
240240
size_type <a href="#find_first">find_first</a>() const;
241241
size_type <a href="#find_next">find_next</a>(size_type pos) const;
242242

243+
iterator <a href="#begin">begin</a>();
244+
const iterator <a href="#begin">begin</a>() const;
245+
246+
const_iterator <a href="#cbegin">cbegin</a>();
247+
const const_iterator <a href="#cbegin">cbegin</a>() const;
248+
249+
iterator <a href="#end">end</a>();
250+
const iterator <a href="#end">end</a>() const;
251+
252+
const_iterator <a href="#cend">cend</a>();
253+
const const_iterator <a href="#cend">cend</a>() const;
254+
255+
reverse_iterator <a href="#rbegin">rbegin</a>();
256+
const reverse_iterator <a href="#rbegin">rbegin</a>() const;
257+
258+
const_reverse_iterator <a href="#crbegin">crbegin</a>();
259+
const const_reverse_iterator <a href="#crbegin">crbegin</a>() const;
260+
261+
reverse_iterator <a href="#rend">rend</a>();
262+
const reverse_iterator <a href="#rend">rend</a>() const;
263+
264+
const_reverse_iterator <a href="#crend">crend</a>();
265+
const const_reverse_iterator <a href="#rend">rend</a>() const;
243266
};
244267

245268

@@ -553,6 +576,26 @@ <h3><a id="nested-type-names">Nested type names</a></h3>
553576
</pre>
554577
The same type as <tt>Allocator</tt>.
555578

579+
<pre>
580+
<a id="iterator">dynamic_bitset::iterator</a>
581+
</pre>
582+
Return a random access iterator to reference.
583+
584+
<pre>
585+
<a id="reverse_iterator">dynamic_bitset::reverse_iterator</a>
586+
</pre>
587+
Return boost::reverse_iterator&lt;iterator&gt;.
588+
589+
<pre>
590+
<a id="const_iterator">dynamic_bitset::const_iterator</a>
591+
</pre>
592+
Return a random access iterator to const_reference.
593+
594+
<pre>
595+
<a id="const_reverse_iterator">dynamic_bitset::const_reverse_iterator</a>
596+
</pre>
597+
Return boost::reverse_iterator&lt;const_iterator&gt;.
598+
556599

557600
<hr />
558601
<h3><a id="public-data-members">Public data members</a></h3>
@@ -1382,6 +1425,67 @@ <h3><a id="member-functions">Member Functions</a></h3>
13821425
<tt>pos</tt> such as bit <tt>i</tt> is set, or <tt>npos</tt> if
13831426
no such index exists.
13841427

1428+
<hr />
1429+
<pre>
1430+
iterator <a id="begin">begin</a>();
1431+
</pre>
1432+
1433+
<b>Returns:</b> an iterator pointing to the first element in the bitset. If
1434+
the bitset is empty, the returned iterator value shall not be dereferenced.
1435+
1436+
<hr />
1437+
<pre>
1438+
iterator <a id="cbegin">cbegin</a>();
1439+
</pre>
1440+
1441+
<b>Returns:</b> the same as <a id="begin">begin</a>(), but read only on this bitset
1442+
1443+
<hr />
1444+
<pre>
1445+
iterator <a id="end">end</a>();
1446+
</pre>
1447+
1448+
<b>Returns:</b> an iterator pointing to the last element in the bitset.
1449+
The returned iterator value shall not be dereferenced.
1450+
1451+
<hr />
1452+
<pre>
1453+
iterator <a id="cend">cend</a>();
1454+
</pre>
1455+
1456+
<b>Returns:</b> the same as <a id="end">end</a>(), but read only on this bitset
1457+
1458+
<hr />
1459+
<pre>
1460+
iterator <a id="rbegin">rbegin</a>();
1461+
</pre>
1462+
1463+
<b>Returns:</b> an reversed iterator pointing to the last element in the bitset.
1464+
The returned reversed iterator value shall not be dereferenced.
1465+
1466+
<hr />
1467+
<pre>
1468+
iterator <a id="rend">rend</a>();
1469+
</pre>
1470+
1471+
<b>Returns:</b> an reversed iterator pointing to the first element in the bitset.
1472+
The returned reversed iterator value shall not be dereferenced.
1473+
1474+
<hr />
1475+
<pre>
1476+
iterator <a id="crbegin">crbegin</a>();
1477+
</pre>
1478+
1479+
<b>Returns:</b> the same as <a id="rbegin">rbegin</a>(), but read only on this bitset
1480+
1481+
<hr />
1482+
<pre>
1483+
iterator <a id="crend">crend</a>();
1484+
</pre>
1485+
1486+
<b>Returns:</b> the same as <a id="rend">rend</a>(), but read only on this bitset
1487+
1488+
13851489
<hr />
13861490
<pre>
13871491
bool <a id=

include/boost/dynamic_bitset/dynamic_bitset.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ inline bool operator>=(const dynamic_bitset<Block, Allocator>& a,
16811681
template <typename Block, typename Allocator>
16821682
inline std::size_t hash_value(const dynamic_bitset<Block, Allocator>& a)
16831683
{
1684-
std::size_t res = hash_value(a.m_num_bits);
1684+
std::size_t res = static_cast<std::size_t>(hash_value(a.m_num_bits));
16851685
boost::hash_combine(res, a.m_bits);
16861686
return res;
16871687
}
@@ -2167,6 +2167,7 @@ bool dynamic_bitset<Block, Allocator>::m_check_invariants() const
21672167

21682168
}
21692169

2170+
21702171
} // namespace boost
21712172

21722173
#undef BOOST_BITSET_CHAR

include/boost/dynamic_bitset/dynamic_bitset_iterator.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ dbs_iterator<Container_t> dbs_iterator<Container_t>::operator--(int)
164164

165165
template <typename Container_t>
166166
dbs_iterator<Container_t> dbs_iterator<Container_t>::operator+(
167-
dbs_iterator<Container_t>::difference_type n) const
167+
typename dbs_iterator<Container_t>::difference_type n) const
168168
{
169169
dbs_iterator<Container_t> temp(*this);
170170
temp += n;
@@ -173,15 +173,15 @@ dbs_iterator<Container_t> dbs_iterator<Container_t>::operator+(
173173

174174
template <typename Container_t>
175175
dbs_iterator<Container_t>& dbs_iterator<Container_t>::operator+=(
176-
dbs_iterator<Container_t>::difference_type n)
176+
typename dbs_iterator<Container_t>::difference_type n)
177177
{
178178
m_pos += n;
179179
return *this;
180180
}
181181

182182
template <typename Container_t>
183183
dbs_iterator<Container_t> dbs_iterator<Container_t>::operator-(
184-
dbs_iterator<Container_t>::difference_type n) const
184+
typename dbs_iterator<Container_t>::difference_type n) const
185185
{
186186
dbs_iterator<Container_t> temp(*this);
187187
temp -= n;
@@ -190,7 +190,7 @@ dbs_iterator<Container_t> dbs_iterator<Container_t>::operator-(
190190

191191
template <typename Container_t>
192192
dbs_iterator<Container_t>& dbs_iterator<Container_t>::operator-=(
193-
dbs_iterator<Container_t>::difference_type n)
193+
typename dbs_iterator<Container_t>::difference_type n)
194194
{
195195
*this += -n;
196196
return *this;
@@ -272,4 +272,4 @@ operator-(const dbs_iterator<Container_t>& lhs,
272272
}
273273

274274
} // namespace boost
275-
#endif // include guard
275+
#endif // include guard

test/bitset_test.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#define BOOST_BITSET_TEST_HPP_GP_20040319
1616

1717
#include <boost/config.hpp>
18-
#include <cstddef>
1918
#if !defined (BOOST_NO_STD_LOCALE)
2019
# include <locale>
2120
#endif
@@ -25,7 +24,7 @@
2524
#include <string> // for (basic_string and) getline()
2625
#include <algorithm> // for std::min
2726
#include <assert.h> // <cassert> is sometimes macro-guarded :-(
28-
#include <numeric> // std::accumulate
27+
#include <cstddef> // std::ptrdiff_t
2928

3029
#include <boost/limits.hpp>
3130
#include <boost/dynamic_bitset/dynamic_bitset.hpp>
@@ -1516,6 +1515,7 @@ struct bitset_test {
15161515
typename Bitset::iterator it = b.begin();
15171516
for (std::size_t i = 0; i < b.size(); ++i) {
15181517
BOOST_TEST(*it == b[i]);
1518+
BOOST_TEST((*it).flip() == b[i]);
15191519
++it;
15201520
}
15211521
}

0 commit comments

Comments
 (0)