diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-03-02 21:11:19 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-03-02 21:11:19 +0000 |
commit | 4cd533a7c73a0813a39b41147c9fe771fd65fd28 (patch) | |
tree | 5e48d10195e6a0bccc697e1485ec1558a6910b5f /libstdc++-v3/testsuite/23_containers | |
parent | 54bceaf397784a87995fa91a039dcb328b120bc9 (diff) | |
download | gcc-4cd533a7c73a0813a39b41147c9fe771fd65fd28.tar.gz |
stl_bvector.h (hash<vector<bool, _Alloc>>): Add.
2010-03-02 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_bvector.h (hash<vector<bool, _Alloc>>): Add.
* include/debug/vector (hash<__debug::vector<bool, _Alloc>>):
Likewise.
* include/profile/vector (hash<__profile::vector<bool, _Alloc>>):
Likewise.
* testsuite/23_containers/vector/bool/hash/1.cc: New.
* include/std/bitset (hash<bitset<_Nb>>): Small tweaks.
(hash<bitset<0>>): Add.
* include/debug/bitset (hash<__debug::bitset<_Nb>>): Forward to
hash<bitset<_Nb>>.
* include/profile/bitset (hash<__profile::bitset<_Nb>>): Likewise.
* testsuite/23_containers/bitset/hash/1.cc: Improve.
From-SVN: r157176
Diffstat (limited to 'libstdc++-v3/testsuite/23_containers')
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/bitset/hash/1.cc | 30 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/vector/bool/hash/1.cc | 45 |
2 files changed, 69 insertions, 6 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/bitset/hash/1.cc b/libstdc++-v3/testsuite/23_containers/bitset/hash/1.cc index 84dc31aba4a..655192e4e8f 100644 --- a/libstdc++-v3/testsuite/23_containers/bitset/hash/1.cc +++ b/libstdc++-v3/testsuite/23_containers/bitset/hash/1.cc @@ -1,4 +1,3 @@ -// { dg-do compile } // { dg-options "-std=gnu++0x" } // Copyright (C) 2010 Free Software Foundation, Inc. @@ -20,8 +19,27 @@ #include <bitset> -// bitset hash -std::hash<std::bitset<0>> h1; -std::hash<std::bitset<10>> h2; -std::hash<std::bitset<100>> h3; -std::hash<std::bitset<1000>> h4; +void test01() +{ + std::bitset<0> b0; + std::hash<std::bitset<0>> h0; + h0(b0); + + std::bitset<10> b1; + std::hash<std::bitset<10>> h1; + h1(b1); + + std::bitset<100> b2; + std::hash<std::bitset<100>> h2; + h2(b2); + + std::bitset<1000> b3; + std::hash<std::bitset<1000>> h3; + h3(b3); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/bool/hash/1.cc b/libstdc++-v3/testsuite/23_containers/vector/bool/hash/1.cc new file mode 100644 index 00000000000..85e91e98ed7 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/bool/hash/1.cc @@ -0,0 +1,45 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <vector> + +void test01() +{ + std::vector<bool> b0; + std::hash<std::vector<bool>> h0; + h0(b0); + + std::vector<bool> b1(10); + std::hash<std::vector<bool>> h1; + h1(b1); + + std::vector<bool> b2(100); + std::hash<std::vector<bool>> h2; + h2(b2); + + std::vector<bool> b3(1000); + std::hash<std::vector<bool>> h3; + h3(b3); +} + +int main() +{ + test01(); + return 0; +} |