Line | |
---|
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) |
---|
5 | // |
---|
6 | // Sample output: |
---|
7 | // bits(0) = 00 |
---|
8 | // bits(1) = 01 |
---|
9 | // bits(2) = 10 |
---|
10 | // bits(3) = 11 |
---|
11 | |
---|
12 | #include <iostream> |
---|
13 | #include <boost/dynamic_bitset.hpp> |
---|
14 | int main() |
---|
15 | { |
---|
16 | const boost::dynamic_bitset<> b0(2, 0ul); |
---|
17 | std::cout << "bits(0) = " << b0 << std::endl; |
---|
18 | |
---|
19 | const boost::dynamic_bitset<> b1(2, 1ul); |
---|
20 | std::cout << "bits(1) = " << b1 << std::endl; |
---|
21 | |
---|
22 | const boost::dynamic_bitset<> b2(2, 2ul); |
---|
23 | std::cout << "bits(2) = " << b2 << std::endl; |
---|
24 | |
---|
25 | const boost::dynamic_bitset<> b3(2, 3ul); |
---|
26 | std::cout << "bits(3) = " << b3 << std::endl; |
---|
27 | |
---|
28 | return EXIT_SUCCESS; |
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.