2009-10-03 04:17:41 +02:00
|
|
|
// Profiling bitset implementation -*- C++ -*-
|
|
|
|
|
2015-01-05 13:33:28 +01:00
|
|
|
// Copyright (C) 2009-2015 Free Software Foundation, Inc.
|
2009-10-03 04:17:41 +02:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
// Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
// permissions described in the GCC Runtime Library Exception, version
|
|
|
|
// 3.1, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License and
|
|
|
|
// a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
// <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
/** @file profile/bitset
|
|
|
|
* This file is a GNU profile extension to the Standard C++ Library.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GLIBCXX_PROFILE_BITSET
|
|
|
|
#define _GLIBCXX_PROFILE_BITSET
|
|
|
|
|
|
|
|
#include <bitset>
|
|
|
|
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
namespace std _GLIBCXX_VISIBILITY(default)
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
|
|
|
namespace __profile
|
|
|
|
{
|
2014-05-24 22:59:00 +02:00
|
|
|
/// Class std::bitset wrapper with performance instrumentation, none at the
|
|
|
|
/// moment.
|
2009-10-03 04:17:41 +02:00
|
|
|
template<size_t _Nb>
|
|
|
|
class bitset
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
: public _GLIBCXX_STD_C::bitset<_Nb>
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
typedef _GLIBCXX_STD_C::bitset<_Nb> _Base;
|
2009-10-03 04:17:41 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
// 23.3.5.1 constructors:
|
2014-05-24 22:59:00 +02:00
|
|
|
#if __cplusplus < 201103L
|
|
|
|
bitset()
|
2011-05-18 20:05:17 +02:00
|
|
|
: _Base() { }
|
2014-05-24 22:59:00 +02:00
|
|
|
#else
|
|
|
|
constexpr bitset() = default;
|
|
|
|
#endif
|
2009-10-03 04:17:41 +02:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2011-05-18 20:05:17 +02:00
|
|
|
constexpr bitset(unsigned long long __val) noexcept
|
2010-01-03 17:17:44 +01:00
|
|
|
#else
|
|
|
|
bitset(unsigned long __val)
|
|
|
|
#endif
|
|
|
|
: _Base(__val) { }
|
2009-10-03 04:17:41 +02:00
|
|
|
|
|
|
|
template<typename _CharT, typename _Traits, typename _Alloc>
|
2014-05-24 22:59:00 +02:00
|
|
|
explicit
|
|
|
|
bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __str,
|
2009-10-03 04:17:41 +02:00
|
|
|
typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
|
|
|
|
__pos = 0,
|
|
|
|
typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
|
|
|
|
__n = (std::basic_string<_CharT, _Traits, _Alloc>::npos))
|
|
|
|
: _Base(__str, __pos, __n) { }
|
|
|
|
|
|
|
|
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
|
|
|
// 396. what are characters zero and one.
|
|
|
|
template<class _CharT, class _Traits, class _Alloc>
|
|
|
|
bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __str,
|
|
|
|
typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
|
|
|
|
__pos,
|
|
|
|
typename std::basic_string<_CharT, _Traits, _Alloc>::size_type
|
|
|
|
__n,
|
|
|
|
_CharT __zero, _CharT __one = _CharT('1'))
|
|
|
|
: _Base(__str, __pos, __n, __zero, __one) { }
|
|
|
|
|
|
|
|
bitset(const _Base& __x) : _Base(__x) { }
|
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2010-10-12 00:32:01 +02:00
|
|
|
template<typename _CharT>
|
2014-05-24 22:59:00 +02:00
|
|
|
explicit
|
|
|
|
bitset(const _CharT* __str,
|
2010-10-12 00:32:01 +02:00
|
|
|
typename std::basic_string<_CharT>::size_type __n
|
|
|
|
= std::basic_string<_CharT>::npos,
|
|
|
|
_CharT __zero = _CharT('0'), _CharT __one = _CharT('1'))
|
|
|
|
: _Base(__str, __n, __zero, __one) { }
|
2009-12-29 01:29:12 +01:00
|
|
|
#endif
|
|
|
|
|
2009-10-03 04:17:41 +02:00
|
|
|
// 23.3.5.2 bitset operations:
|
|
|
|
bitset<_Nb>&
|
2011-05-18 20:05:17 +02:00
|
|
|
operator&=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
|
|
|
_M_base() &= __rhs;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bitset<_Nb>&
|
2011-05-18 20:05:17 +02:00
|
|
|
operator|=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
|
|
|
_M_base() |= __rhs;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bitset<_Nb>&
|
2011-05-18 20:05:17 +02:00
|
|
|
operator^=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
|
|
|
_M_base() ^= __rhs;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bitset<_Nb>&
|
2011-05-18 20:05:17 +02:00
|
|
|
operator<<=(size_t __pos) _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
|
|
|
_M_base() <<= __pos;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bitset<_Nb>&
|
2011-05-18 20:05:17 +02:00
|
|
|
operator>>=(size_t __pos) _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
|
|
|
_M_base() >>= __pos;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bitset<_Nb>&
|
2011-05-18 20:05:17 +02:00
|
|
|
set() _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
|
|
|
_Base::set();
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
|
|
|
// 186. bitset::set() second parameter should be bool
|
|
|
|
bitset<_Nb>&
|
|
|
|
set(size_t __pos, bool __val = true)
|
|
|
|
{
|
|
|
|
_Base::set(__pos, __val);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bitset<_Nb>&
|
2011-05-18 20:05:17 +02:00
|
|
|
reset() _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
|
|
|
_Base::reset();
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bitset<_Nb>&
|
|
|
|
reset(size_t __pos)
|
|
|
|
{
|
|
|
|
_Base::reset(__pos);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2011-05-18 20:05:17 +02:00
|
|
|
bitset<_Nb>
|
|
|
|
operator~() const _GLIBCXX_NOEXCEPT
|
|
|
|
{ return bitset(~_M_base()); }
|
2009-10-03 04:17:41 +02:00
|
|
|
|
|
|
|
bitset<_Nb>&
|
2011-05-18 20:05:17 +02:00
|
|
|
flip() _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{
|
|
|
|
_Base::flip();
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bitset<_Nb>&
|
|
|
|
flip(size_t __pos)
|
|
|
|
{
|
|
|
|
_Base::flip(__pos);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2011-05-18 20:05:17 +02:00
|
|
|
operator==(const bitset<_Nb>& __rhs) const _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return _M_base() == __rhs; }
|
|
|
|
|
|
|
|
bool
|
2011-05-18 20:05:17 +02:00
|
|
|
operator!=(const bitset<_Nb>& __rhs) const _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return _M_base() != __rhs; }
|
|
|
|
|
|
|
|
bitset<_Nb>
|
2011-05-18 20:05:17 +02:00
|
|
|
operator<<(size_t __pos) const _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return bitset<_Nb>(_M_base() << __pos); }
|
|
|
|
|
|
|
|
bitset<_Nb>
|
2011-05-18 20:05:17 +02:00
|
|
|
operator>>(size_t __pos) const _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return bitset<_Nb>(_M_base() >> __pos); }
|
|
|
|
|
|
|
|
_Base&
|
2011-05-18 20:05:17 +02:00
|
|
|
_M_base() _GLIBCXX_NOEXCEPT
|
|
|
|
{ return *this; }
|
2009-10-03 04:17:41 +02:00
|
|
|
|
|
|
|
const _Base&
|
2011-05-18 20:05:17 +02:00
|
|
|
_M_base() const _GLIBCXX_NOEXCEPT
|
|
|
|
{ return *this; }
|
2009-10-03 04:17:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
template<size_t _Nb>
|
|
|
|
bitset<_Nb>
|
2011-05-18 20:05:17 +02:00
|
|
|
operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return bitset<_Nb>(__x) &= __y; }
|
|
|
|
|
|
|
|
template<size_t _Nb>
|
|
|
|
bitset<_Nb>
|
2011-05-18 20:05:17 +02:00
|
|
|
operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return bitset<_Nb>(__x) |= __y; }
|
|
|
|
|
|
|
|
template<size_t _Nb>
|
|
|
|
bitset<_Nb>
|
2011-05-18 20:05:17 +02:00
|
|
|
operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
|
2009-10-03 04:17:41 +02:00
|
|
|
{ return bitset<_Nb>(__x) ^= __y; }
|
|
|
|
|
|
|
|
template<typename _CharT, typename _Traits, size_t _Nb>
|
|
|
|
std::basic_istream<_CharT, _Traits>&
|
|
|
|
operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
|
|
|
|
{ return __is >> __x._M_base(); }
|
|
|
|
|
|
|
|
template<typename _CharT, typename _Traits, size_t _Nb>
|
|
|
|
std::basic_ostream<_CharT, _Traits>&
|
|
|
|
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
|
|
|
|
const bitset<_Nb>& __x)
|
|
|
|
{ return __os << __x._M_base(); }
|
|
|
|
} // namespace __profile
|
2010-03-02 15:08:52 +01:00
|
|
|
|
2012-11-10 18:27:22 +01:00
|
|
|
#if __cplusplus >= 201103L
|
2010-03-02 15:08:52 +01:00
|
|
|
// DR 1182.
|
|
|
|
/// std::hash specialization for bitset.
|
|
|
|
template<size_t _Nb>
|
2010-03-03 03:01:56 +01:00
|
|
|
struct hash<__profile::bitset<_Nb>>
|
2010-09-22 19:50:36 +02:00
|
|
|
: public __hash_base<size_t, __profile::bitset<_Nb>>
|
2010-03-02 15:08:52 +01:00
|
|
|
{
|
|
|
|
size_t
|
hash-long-double-aux.cc: Rename to...
2011-11-18 Paolo Carlini <paolo.carlini@oracle.com>
* src/hash-long-double-aux.cc: Rename to...
* src/hash-long-double-tr1-aux.cc: ... this.
* src/compatibility-ldbl.cc: Adjust.
* src/hash_tr1.cc: Likewise.
* src/hash_c++0x.cc: Don't use src/hash-long-double-aux.cc.
* include/bits/functional_hash.h (hash<_Tp*>::operator(), specs
for integer types, hash<float>::operator(), hash<double>::operator(),
hash<long double>::operator()): Declare noexcept.
* include/debug/bitset (hash<__debug::bitset>::operator()): Likewise.
* include/debug/vector (hash<__debug::vector>::operator()): Likewise.
* include/std/system_error (hash<error_code>::operator()): Likewise.
* include/std/thread (hash<thread::id>::operator()): Likewise.
* include/std/bitset (hash<bitset>::operator()): Likewise.
* include/std/typeindex (hash<type_index>::operator()): Likewise.
* include/profile/bitset (hash<__profile::vector>::operator()):
Likewise.
* include/profile/vector (hash<__profile::vector>::operator()):
Likewise.
* include/ext/vstring.h (hash<__vstring>::operator(),
hash<__wvstring>::operator(), hash<__u16vstring>::operator(),
hash<__u32vstring>::operator()): Likewise.
* include/bits/shared_ptr.h (hash<shared_ptr>::operator()): Likewise.
* include/bits/shared_ptr_base.h (hash<__shared_ptr>::operator()):
Likewise.
* include/bits/unique_ptr.h (hash<unique_ptr>::operator()): Likewise.
* include/bits/basic_string.h (hash<string>::operator(),
hash<wstring>::operator(), hash<u16string>::operator(),
hash<u32string>::operator()): Likewise.
* include/bits/vector.tcc (hash<vector>::operator()): Likewise.
* include/bits/stl_bvector.h (hash<vector>::operator()): Likewise.
* libsupc++/typeinfo (type_info::hash_code): Use noexcept instead of
throw().
From-SVN: r181473
2011-11-18 13:37:06 +01:00
|
|
|
operator()(const __profile::bitset<_Nb>& __b) const noexcept
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
{ return std::hash<_GLIBCXX_STD_C::bitset<_Nb>>()(__b._M_base()); }
|
2010-03-02 15:08:52 +01:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2009-10-03 04:17:41 +02:00
|
|
|
} // namespace std
|
|
|
|
|
|
|
|
#endif
|