• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright (C) 2018 James E. King III
3 //
4 // Permission to copy, use, modify, sell and distribute this software
5 // is granted provided this copyright notice appears in all copies.
6 // This software is provided "as is" without express or implied
7 // warranty, and with no claim as to its suitability for any purpose.
8 //
9 // Distributed under the Boost Software License, Version 1.0. (See
10 // accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
12 //
13 
14 #include <boost/dynamic_bitset.hpp>
15 #include <boost/core/lightweight_test.hpp>
16 
main(int,char * [])17 int main(int, char*[])
18 {
19     boost::dynamic_bitset<> x(5); // all 0's by default
20     x.set(1, 2);
21     x.set(3, 1, true);
22     x.set(2, 1, false);
23     BOOST_TEST(!x.test(0));
24     BOOST_TEST( x.test(1));
25     BOOST_TEST(!x.test(2));
26     BOOST_TEST( x.test(3));
27     BOOST_TEST(!x.test(4));
28 
29     return boost::report_errors();
30 }
31