]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/dynamic_bitset/example/example1.cpp
1 // (C) Copyright Jeremy Siek 2001.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
8 // An example of setting and reading some bits. Note that operator[]
9 // goes from the least-significant bit at 0 to the most significant
10 // bit at size()-1. The operator<< for dynamic_bitset prints the
11 // bitset from most-significant to least-significant, since that is
12 // the format most people are used to reading.
18 // ---------------------------------------------------------------------
21 #include <boost/dynamic_bitset.hpp>
25 boost::dynamic_bitset
<> x(5); // all 0's by default
29 for (boost::dynamic_bitset
<>::size_type i
= 0; i
< x
.size(); ++i
)
32 std::cout
<< x
<< "\n";