]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/23_containers/bitset/cons/6282.cc
3 // Copyright (C) 1999, 2000, 2002, 2003, 2009 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
20 // 23.3.5.1 bitset constructors
25 #include <testsuite_hooks.h>
27 // boundary condition: a zero-sized set
31 using std::char_traits
; using std::allocator
;
32 bool test
__attribute__((unused
)) = true;
35 VERIFY( z1
.any() == false );
37 std::bitset
<0> z2(12345);
38 VERIFY( z2
.any() == false );
40 std::bitset
<0> z3(std::string("10101010101"));
41 VERIFY( z3
.any() == false );
47 catch(std::out_of_range
& fail
) {
54 VERIFY( z1
.to_ulong() == 0 );
55 VERIFY( (z1
.to_string
<char,char_traits
<char>,allocator
<char> >().empty() ));