2005-05-27 17:01:45 +02:00
|
|
|
// Debugging support implementation -*- C++ -*-
|
|
|
|
|
2018-01-03 11:03:58 +01:00
|
|
|
// Copyright (C) 2003-2018 Free Software Foundation, Inc.
|
2005-05-27 17:01:45 +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
|
2009-04-09 17:00:19 +02:00
|
|
|
// Free Software Foundation; either version 3, or (at your option)
|
2005-05-27 17:01:45 +02:00
|
|
|
// 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.
|
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
// 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/>.
|
2005-05-27 17:01:45 +02:00
|
|
|
|
2006-11-29 21:59:22 +01:00
|
|
|
/** @file debug/functions.h
|
|
|
|
* This file is a GNU debug extension to the Standard C++ Library.
|
|
|
|
*/
|
|
|
|
|
2005-05-27 17:01:45 +02:00
|
|
|
#ifndef _GLIBCXX_DEBUG_FUNCTIONS_H
|
|
|
|
#define _GLIBCXX_DEBUG_FUNCTIONS_H 1
|
|
|
|
|
2016-05-13 16:47:46 +02:00
|
|
|
#include <bits/move.h> // for __addressof
|
|
|
|
#include <bits/stl_function.h> // for less
|
2013-08-01 21:54:46 +02:00
|
|
|
#if __cplusplus >= 201103L
|
2016-05-13 16:47:46 +02:00
|
|
|
# include <type_traits> // for is_lvalue_reference and conditional.
|
2013-08-01 21:54:46 +02:00
|
|
|
#endif
|
2015-05-29 François Dumont fdumont@gcc.gnu.org>
* include/debug/debug.h (_GLIBCXX_DEBUG_ASSERT,
_GLIBCXX_DEBUG_PEDASSERT, _GLIBCXX_DEBUG_ONLY): Move definition...
* include/debug/assertions.h: ...here, new.
* include/debug/formatter.h
(_Error_formatter::_Is_iterator_value_type): New.
(_Error_formatter::_Is_instance): New.
(_Error_formatter::_Parameter): Make public and not friend anymore.
(_Error_formatter::_Parameter::__instance): New _M_kind enum entry.
(_Error_formatter::_Parameter::__iterator_value_type): New _M_kind enum
entry.
(_Error_formatter::_Parameter::_Type): New.
(_Error_formatter::_Parameter::_Instance): New, inherit from
latter.
(union _Error_formatter::_Parameter::_M_variant): Reorganize.
(_Parameter(_Iterator const&, const char*, _Is_iterator)): Make all
overloads take iterator through a const reference.
(_Parameter(const _Iterator&, const char*, _Is_iterator_value_type)):
New.
(_Parameter(const _Type&, const char*, _Is_instance)): New.
(_Error_formatter::_M_print_type): Delete.
(_Error_formatter::_M_iterator_value_type): New.
(_Error_formatter::_M_instance): New.
* include/Makefile.am: Add new above debug file.
* include/Makefile.in: Regenerate.
* include/debug/functions.h
(__check_dereferenceable(const _Safe_iterator<>&),
__valid_range(const _Safe_iterator<>&),
__is_safe_random_iterator<_Safe_iterator<>>): Move...
* include/debug/safe_iterator.h: ... here.
Replace debug.h include with assertions.h.
(__check_singular_aux): Move...
* include/debug/safe_base.h: ... here.
* include/debug/functions.h
(__check_dereferenceable(const _Safe_local_iterator<>&),
__valid_range(const _Safe_local_iterator<>&): Move...
* include/debug/safe_local_iterator.h: ...here.
* include/debug/safe_sequence.h: Replace debug.h with assertions.h.
Remove _Safe_iterator declaration.
* include/debug/safe_unordered_container.h: Replace debug.h with
assertions.h.
* include/debug/array: Replace safe_sequence.h include with
formatter.h and macros.h.
* include/debug/deque: Include functions.tcc.
* include/debug/forward_list: Likewise.
* include/debug/list: Likewise.
* include/debug/string: Likewise.
* include/debug/vector: Likewise.
* include/bits/unique_ptr.h: Replace debug.h include with new
assertions.h.
* include/bits/stl_iterator_base_funcs.h: Likewise.
* testsuite/23_containers/array/tuple_interface/get_debug_neg.cc:
Adjust dg-error line number.
* testsuite/23_containers/array/tuple_interface/
tuple_element_debug_neg.cc: Likewise.
* src/c++11/debug.cc: Adapt.
From-SVN: r223877
2015-05-29 23:29:07 +02:00
|
|
|
|
stl_iterator_base_types.h (_Iter_base): Limit definition to pre-C++11 mode.
2015-06-29 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_iterator_base_types.h (_Iter_base): Limit definition
to pre-C++11 mode.
* include/debug/functions.h
(__gnu_debug::__valid_range, __gnu_debug::__base): Move...
* include/debug/safe_iterator.h
(__gnu_debug::_Sequence_traits): New.
(__gnu_debug::__get_distance_from_begin): New.
(__gnu_debug::__get_distance_to_end): New.
(__gnu_debug::_Safe_iterator<>::_M_valid_range): Expose iterator range
distance information. Add optional check_dereferenceable parameter,
default true.
(__gnu_debug::_Distance_precision, __gnu_debug::__get_distance): Move
default definition...
(__gnu_debug::__get_distance): New overload for _Safe_iterator.
(__gnu_debug::__unsafe): Likewise.
* include/debug/helper_functions.h: ...here. New.
(__gnu_debug::__unsafe): New helper function to remove safe iterator
layer.
* include/debug/stl_iterator.h: New. Include latter.
* include/bits/stl_iterator.h: Include latter in debug mode.
* include/debug/stl_iterator.tcc: Adapt.
* include/debug/safe_local_iterator.h (__gnu_debug::__get_distance): Add
overload for _Safe_local_iterator.
(__gnu_debug::__unsafe): Likewise.
* include/debug/safe_local_iterator.tcc: Adapt.
* include/debug/macros.h (__glibcxx_check_valid_range2): New.
(__glibcxx_check_insert_range): Add _Dist parameter.
(__glibcxx_check_insert_range_after): Likewise.
(__glibcxx_check_string, __glibcxx_check_string_len): Implement using
_GLIBCXX_DEBUG_PEDASSERT.
* include/debug/deque (deque<>::assign): Remove iterator debug layer
when possible.
(deque<>::insert): Likewise.
* include/debug/forward_list (__glibcxx_check_valid_fl_range): New.
(forward_list<>::splice_after): Use latter.
(forward_list<>::assign): Remove iterator debug layer when possible.
(forward_list<>::insert_after): Likewise.
(__gnu_debug::_Sequence_traits<>): Partial specialization.
* include/debug/list (list<>::assign): Remove iterator debug layer when
possible.
(list<>::insert): Likewise.
[__gnu_debug::_Sequence_traits<>]: Partial specialization pre C++11 ABI.
* include/debug/map.h (map<>::insert): Remove iterator debug layer when
possible.
* include/debug/multimap.h (multimap<>::insert): Likewise.
* include/debug/set.h (set<>::insert): Likewise.
* include/debug/multiset.h (multiset<>::insert): Likewise.
* include/debug/string (basic_string<>::append, basic_string<>::assign,
basic_string<>::insert, basic_string<>::replace): Likewise.
* include/debug/unordered_map
(unordered_map<>::insert, unordered_multimap<>::insert): Likewise.
* include/debug/unordered_set
(unordered_set<>::insert, unordered_multiset<>insert): Likewise.
* include/debug/vector
(vector<>::assign, vector<>::insert): Likewise.
* include/Makefile.am: Add new debug headers.
* include/Makefile.in: Regenerate.
From-SVN: r225143
2015-06-29 22:17:56 +02:00
|
|
|
#include <debug/helper_functions.h>
|
[multiple changes]
2010-08-29 Paolo Carlini <paolo.carlini@oracle.com>
* testsuite/23_containers/bitset/invalidation: Move...
* testsuite/23_containers/bitset/debug/invalidation: ... here.
* testsuite/23_containers/deque/invalidation: Move...
* testsuite/23_containers/deque/debug/invalidation: ... here.
* testsuite/23_containers/list/invalidation: Move...
* testsuite/23_containers/list/debug/invalidation: ... here.
* testsuite/23_containers/map/invalidation: Move...
* testsuite/23_containers/map/debug/invalidation: ... here.
* testsuite/23_containers/multimap/invalidation: Move...
* testsuite/23_containers/multimap/debug/invalidation: ... here.
* testsuite/23_containers/set/invalidation: Move...
* testsuite/23_containers/set/debug/invalidation: ... here.
* testsuite/23_containers/multiset/invalidation: Move...
* testsuite/23_containers/multiset/debug/invalidation: ... here.
* testsuite/23_containers/vector/invalidation: Move...
* testsuite/23_containers/vector/debug/invalidation: ... here.
2010-08-29 François Dumont <francois.cppdevs@free.fr>
* include/bits/stl_algobase.h (_Iter_base): Move...
* include/bits/stl_iterator_base_types.h: ...here.
* include/debug/functions.h (__check_valid_range, __check_string,
__check_sorted): Fix to not depend on _GLIBCXX_DEBUG; include
formatter.h and use formatting macros for a consistent debug result.
* include/debug/formatter.h (__check_singular): Declare; do not
include debug.h.
* include/debug/debug.h: Do not include formatter.h.
* include/debug/safe_iterator.h (_Safe_iterator::_Base_Iterator)
rename to iterator_type.
(__gnu_debug::__base): Add.
* include/debug/set.h: Use everywhere __gnu_debug::__base once
iterator range valided.
* include/debug/unordered_map: Likewise.
* include/debug/multiset.h: Likewise.
* include/debug/vector: Likewise.
* include/debug/unordered_set: Likewise.
* include/debug/deque: Likewise.
* include/debug/map.h: Likewise.
* include/debug/string: Likewise.
* include/debug/list: Likewise.
* include/debug/multimap.h: Likewise.
* testsuite/23_containers/util/debug/assign_neg.h: New test cases on
debug checks performed on container assign operation.
* testsuite/23_containers/util/debug/construct_neg.h: New test cases
on debug checks on constructors.
* testsuite/23_containers/util/debug/insert_neg.h: New test cases on
debug checks performed on container insert operations.
* testsuite/23_containers/unordered_map/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: New.
* testsuite/23_containers/multimap/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/set/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/unordered_multimap/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/unordered_set/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/multiset/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/unordered_multiset/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/map/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/vector/debug/cont_traits.h,
debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc,
assign4_neg.cc, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/deque/debug/cont_traits.h,
debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc,
assign4_neg.cc, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/list/debug/cont_traits.h,
debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc,
assign4_neg.cc, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/performance/23_containers/range_construct/
list_construct1.cc: New, validate performance impact of the patch
on the debug mode.
* testsuite/performance/23_containers/range_construct/
list_construct2.cc: Likewise.
* testsuite/performance/23_containers/range_construct/
vector_construct.cc: Likewise.
* testsuite/performance/23_containers/range_construct/
deque_construct.cc: Likewise.
From-SVN: r163628
2010-08-29 19:39:00 +02:00
|
|
|
#include <debug/formatter.h>
|
2005-05-27 17:01:45 +02:00
|
|
|
|
|
|
|
namespace __gnu_debug
|
|
|
|
{
|
2013-08-01 21:54:46 +02:00
|
|
|
template<typename _Sequence>
|
|
|
|
struct _Insert_range_from_self_is_safe
|
|
|
|
{ enum { __value = 0 }; };
|
|
|
|
|
2014-03-21 19:54:06 +01:00
|
|
|
template<typename _Sequence>
|
|
|
|
struct _Is_contiguous_sequence : std::__false_type { };
|
|
|
|
|
2005-05-27 17:01:45 +02:00
|
|
|
// An arbitrary iterator pointer is not singular.
|
|
|
|
inline bool
|
|
|
|
__check_singular_aux(const void*) { return false; }
|
|
|
|
|
|
|
|
// We may have an iterator that derives from _Safe_iterator_base but isn't
|
|
|
|
// a _Safe_iterator.
|
|
|
|
template<typename _Iterator>
|
|
|
|
inline bool
|
2013-10-25 21:25:06 +02:00
|
|
|
__check_singular(const _Iterator& __x)
|
2015-06-16 23:04:53 +02:00
|
|
|
{ return __check_singular_aux(std::__addressof(__x)); }
|
2005-05-27 17:01:45 +02:00
|
|
|
|
|
|
|
/** Non-NULL pointers are nonsingular. */
|
|
|
|
template<typename _Tp>
|
|
|
|
inline bool
|
|
|
|
__check_singular(const _Tp* __ptr)
|
|
|
|
{ return __ptr == 0; }
|
|
|
|
|
|
|
|
/** Assume that some arbitrary iterator is dereferenceable, because we
|
|
|
|
can't prove that it isn't. */
|
|
|
|
template<typename _Iterator>
|
|
|
|
inline bool
|
2013-10-25 21:25:06 +02:00
|
|
|
__check_dereferenceable(const _Iterator&)
|
2005-05-27 17:01:45 +02:00
|
|
|
{ return true; }
|
|
|
|
|
|
|
|
/** Non-NULL pointers are dereferenceable. */
|
|
|
|
template<typename _Tp>
|
|
|
|
inline bool
|
|
|
|
__check_dereferenceable(const _Tp* __ptr)
|
|
|
|
{ return __ptr; }
|
|
|
|
|
|
|
|
/* Checks that [first, last) is a valid range, and then returns
|
|
|
|
* __first. This routine is useful when we can't use a separate
|
|
|
|
* assertion statement because, e.g., we are in a constructor.
|
|
|
|
*/
|
|
|
|
template<typename _InputIterator>
|
|
|
|
inline _InputIterator
|
|
|
|
__check_valid_range(const _InputIterator& __first,
|
macros.h (__glibcxx_check_valid_range_at): New.
2018-05-08 François Dumont <fdumont@gcc.gnu.org>
* include/debug/macros.h (__glibcxx_check_valid_range_at): New.
* include/debug/functions.h (__check_valid_range): Use latter.
* include/debug/macros.h (__glibcxx_check_valid_constructor_range): New,
use latter.
* include/debug/deque
(deque::deque<_Iter>(_Iter, _Iter, const _Alloc&)): Use latter.
* include/debug/forward_list
(forward_list::forward_list<_Iter>(_Iter, _Iter, const _Alloc&)):
Likewise.
* include/debug/list
(list::list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise.
* include/debug/list
(list::list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise.
* include/debug/map.h
(map::map<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise.
(map::map<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)):
Likewise.
* include/debug/multimap.h
(multimap::multimap<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise.
(multimap::multimap<_Iter>(_Iter, _Iter, const _Compare&,
const _Alloc&)): Likewise.
* include/debug/set.h
(set::set<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise.
(set::set<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)):
Likewise.
* include/debug/multiset.h
(multiset::multiset<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise.
(multiset::multiset<_Iter>(_Iter, _Iter, const _Compare&,
const _Alloc&)): Likewise.
* include/debug/string
(basic_string::basic_string<_Iter>(_Iter, _Iter, const _Alloc&)):
Likewise.
* include/debug/unordered_map
(unordered_map::unordered_map<_Iter>(_Iter, _Iter, const _Alloc&)):
Likewise.
(unordered_multimap::unordered_multimap<_Iter>(_Iter, _Iter,
const _Alloc&)): Likewise.
* include/debug/unordered_set
(unordered_set::unordered_set<_Iter>(_Iter, _Iter, const _Alloc&)):
Likewise.
(unordered_multiset::unordered_multiset<_Iter>(_Iter, _Iter,
const _Alloc&)): Likewise.
* include/debug/vector
(vector::vector<_Iter>(_Iter, _Iter, const _Alloc&)): Use latter.
From-SVN: r260053
2018-05-08 21:46:59 +02:00
|
|
|
const _InputIterator& __last,
|
|
|
|
const char* __file,
|
|
|
|
unsigned int __line,
|
|
|
|
const char* __function)
|
2005-05-27 17:01:45 +02:00
|
|
|
{
|
macros.h (__glibcxx_check_valid_range_at): New.
2018-05-08 François Dumont <fdumont@gcc.gnu.org>
* include/debug/macros.h (__glibcxx_check_valid_range_at): New.
* include/debug/functions.h (__check_valid_range): Use latter.
* include/debug/macros.h (__glibcxx_check_valid_constructor_range): New,
use latter.
* include/debug/deque
(deque::deque<_Iter>(_Iter, _Iter, const _Alloc&)): Use latter.
* include/debug/forward_list
(forward_list::forward_list<_Iter>(_Iter, _Iter, const _Alloc&)):
Likewise.
* include/debug/list
(list::list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise.
* include/debug/list
(list::list<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise.
* include/debug/map.h
(map::map<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise.
(map::map<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)):
Likewise.
* include/debug/multimap.h
(multimap::multimap<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise.
(multimap::multimap<_Iter>(_Iter, _Iter, const _Compare&,
const _Alloc&)): Likewise.
* include/debug/set.h
(set::set<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise.
(set::set<_Iter>(_Iter, _Iter, const _Compare&, const _Alloc&)):
Likewise.
* include/debug/multiset.h
(multiset::multiset<_Iter>(_Iter, _Iter, const _Alloc&)): Likewise.
(multiset::multiset<_Iter>(_Iter, _Iter, const _Compare&,
const _Alloc&)): Likewise.
* include/debug/string
(basic_string::basic_string<_Iter>(_Iter, _Iter, const _Alloc&)):
Likewise.
* include/debug/unordered_map
(unordered_map::unordered_map<_Iter>(_Iter, _Iter, const _Alloc&)):
Likewise.
(unordered_multimap::unordered_multimap<_Iter>(_Iter, _Iter,
const _Alloc&)): Likewise.
* include/debug/unordered_set
(unordered_set::unordered_set<_Iter>(_Iter, _Iter, const _Alloc&)):
Likewise.
(unordered_multiset::unordered_multiset<_Iter>(_Iter, _Iter,
const _Alloc&)): Likewise.
* include/debug/vector
(vector::vector<_Iter>(_Iter, _Iter, const _Alloc&)): Use latter.
From-SVN: r260053
2018-05-08 21:46:59 +02:00
|
|
|
__glibcxx_check_valid_range_at(__first, __last,
|
|
|
|
__file, __line, __function);
|
2005-05-27 17:01:45 +02:00
|
|
|
return __first;
|
|
|
|
}
|
|
|
|
|
2014-03-21 19:54:06 +01:00
|
|
|
/* Handle the case where __other is a pointer to _Sequence::value_type. */
|
2013-08-30 22:55:37 +02:00
|
|
|
template<typename _Iterator, typename _Sequence>
|
2013-08-01 21:54:46 +02:00
|
|
|
inline bool
|
|
|
|
__foreign_iterator_aux4(const _Safe_iterator<_Iterator, _Sequence>& __it,
|
2014-03-21 19:54:06 +01:00
|
|
|
const typename _Sequence::value_type* __other)
|
2013-08-01 21:54:46 +02:00
|
|
|
{
|
2014-03-21 19:54:06 +01:00
|
|
|
typedef const typename _Sequence::value_type* _PointerType;
|
|
|
|
typedef std::less<_PointerType> _Less;
|
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
constexpr _Less __l{};
|
|
|
|
#else
|
|
|
|
const _Less __l = _Less();
|
|
|
|
#endif
|
|
|
|
const _Sequence* __seq = __it._M_get_sequence();
|
|
|
|
const _PointerType __begin = std::__addressof(*__seq->_M_base().begin());
|
|
|
|
const _PointerType __end = std::__addressof(*(__seq->_M_base().end()-1));
|
2013-08-01 21:54:46 +02:00
|
|
|
|
2014-03-21 19:54:06 +01:00
|
|
|
// Check whether __other points within the contiguous storage.
|
|
|
|
return __l(__other, __begin) || __l(__end, __other);
|
2013-08-01 21:54:46 +02:00
|
|
|
}
|
2013-08-30 22:55:37 +02:00
|
|
|
|
2014-03-21 19:54:06 +01:00
|
|
|
/* Fallback overload for when we can't tell, assume it is valid. */
|
|
|
|
template<typename _Iterator, typename _Sequence>
|
2013-08-30 22:55:37 +02:00
|
|
|
inline bool
|
2014-03-21 19:54:06 +01:00
|
|
|
__foreign_iterator_aux4(const _Safe_iterator<_Iterator, _Sequence>&, ...)
|
2013-08-30 22:55:37 +02:00
|
|
|
{ return true; }
|
|
|
|
|
2014-03-21 19:54:06 +01:00
|
|
|
/* Handle sequences with contiguous storage */
|
2013-08-01 21:54:46 +02:00
|
|
|
template<typename _Iterator, typename _Sequence, typename _InputIterator>
|
|
|
|
inline bool
|
|
|
|
__foreign_iterator_aux3(const _Safe_iterator<_Iterator, _Sequence>& __it,
|
2014-03-21 19:54:06 +01:00
|
|
|
const _InputIterator& __other,
|
|
|
|
const _InputIterator& __other_end,
|
|
|
|
std::__true_type)
|
2013-08-01 21:54:46 +02:00
|
|
|
{
|
2014-03-21 19:54:06 +01:00
|
|
|
if (__other == __other_end)
|
|
|
|
return true; // inserting nothing is safe even if not foreign iters
|
|
|
|
if (__it._M_get_sequence()->begin() == __it._M_get_sequence()->end())
|
|
|
|
return true; // can't be self-inserting if self is empty
|
|
|
|
return __foreign_iterator_aux4(__it, std::__addressof(*__other));
|
2013-08-01 21:54:46 +02:00
|
|
|
}
|
2014-03-21 19:54:06 +01:00
|
|
|
|
|
|
|
/* Handle non-contiguous containers, assume it is valid. */
|
2013-08-01 21:54:46 +02:00
|
|
|
template<typename _Iterator, typename _Sequence, typename _InputIterator>
|
|
|
|
inline bool
|
2014-03-21 19:54:06 +01:00
|
|
|
__foreign_iterator_aux3(const _Safe_iterator<_Iterator, _Sequence>&,
|
|
|
|
const _InputIterator&, const _InputIterator&,
|
|
|
|
std::__false_type)
|
2013-08-01 21:54:46 +02:00
|
|
|
{ return true; }
|
2013-08-30 22:55:37 +02:00
|
|
|
|
2014-03-21 19:54:06 +01:00
|
|
|
/** Handle debug iterators from the same type of container. */
|
2013-08-01 21:54:46 +02:00
|
|
|
template<typename _Iterator, typename _Sequence, typename _OtherIterator>
|
|
|
|
inline bool
|
|
|
|
__foreign_iterator_aux2(const _Safe_iterator<_Iterator, _Sequence>& __it,
|
|
|
|
const _Safe_iterator<_OtherIterator, _Sequence>& __other,
|
2014-03-21 19:54:06 +01:00
|
|
|
const _Safe_iterator<_OtherIterator, _Sequence>&)
|
2013-08-01 21:54:46 +02:00
|
|
|
{ return __it._M_get_sequence() != __other._M_get_sequence(); }
|
2014-03-21 19:54:06 +01:00
|
|
|
|
|
|
|
/** Handle debug iterators from different types of container. */
|
|
|
|
template<typename _Iterator, typename _Sequence, typename _OtherIterator,
|
|
|
|
typename _OtherSequence>
|
|
|
|
inline bool
|
|
|
|
__foreign_iterator_aux2(const _Safe_iterator<_Iterator, _Sequence>& __it,
|
|
|
|
const _Safe_iterator<_OtherIterator, _OtherSequence>&,
|
|
|
|
const _Safe_iterator<_OtherIterator, _OtherSequence>&)
|
|
|
|
{ return true; }
|
|
|
|
|
|
|
|
/* Handle non-debug iterators. */
|
2013-08-01 21:54:46 +02:00
|
|
|
template<typename _Iterator, typename _Sequence, typename _InputIterator>
|
|
|
|
inline bool
|
|
|
|
__foreign_iterator_aux2(const _Safe_iterator<_Iterator, _Sequence>& __it,
|
2014-03-21 19:54:06 +01:00
|
|
|
const _InputIterator& __other,
|
|
|
|
const _InputIterator& __other_end)
|
2013-08-01 21:54:46 +02:00
|
|
|
{
|
2014-10-15 22:40:31 +02:00
|
|
|
#if __cplusplus < 201103L
|
|
|
|
typedef _Is_contiguous_sequence<_Sequence> __tag;
|
|
|
|
#else
|
|
|
|
using __lvalref = std::is_lvalue_reference<
|
|
|
|
typename std::iterator_traits<_InputIterator>::reference>;
|
|
|
|
using __contiguous = _Is_contiguous_sequence<_Sequence>;
|
|
|
|
using __tag = typename std::conditional<__lvalref::value, __contiguous,
|
|
|
|
std::__false_type>::type;
|
|
|
|
#endif
|
|
|
|
return __foreign_iterator_aux3(__it, __other, __other_end, __tag());
|
2013-08-01 21:54:46 +02:00
|
|
|
}
|
2014-03-21 19:54:06 +01:00
|
|
|
|
|
|
|
/* Handle the case where we aren't really inserting a range after all */
|
|
|
|
template<typename _Iterator, typename _Sequence, typename _Integral>
|
2013-08-01 21:54:46 +02:00
|
|
|
inline bool
|
2014-03-21 19:54:06 +01:00
|
|
|
__foreign_iterator_aux(const _Safe_iterator<_Iterator, _Sequence>&,
|
|
|
|
_Integral, _Integral,
|
2013-08-01 21:54:46 +02:00
|
|
|
std::__true_type)
|
|
|
|
{ return true; }
|
|
|
|
|
2014-03-21 19:54:06 +01:00
|
|
|
/* Handle all iterators. */
|
2013-08-01 21:54:46 +02:00
|
|
|
template<typename _Iterator, typename _Sequence,
|
|
|
|
typename _InputIterator>
|
|
|
|
inline bool
|
|
|
|
__foreign_iterator_aux(const _Safe_iterator<_Iterator, _Sequence>& __it,
|
2014-03-21 19:54:06 +01:00
|
|
|
_InputIterator __other, _InputIterator __other_end,
|
2013-08-01 21:54:46 +02:00
|
|
|
std::__false_type)
|
|
|
|
{
|
2014-03-21 19:54:06 +01:00
|
|
|
return _Insert_range_from_self_is_safe<_Sequence>::__value
|
2015-07-16 21:17:26 +02:00
|
|
|
|| __foreign_iterator_aux2(__it, std::__miter_base(__other),
|
|
|
|
std::__miter_base(__other_end));
|
2013-08-01 21:54:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template<typename _Iterator, typename _Sequence,
|
|
|
|
typename _InputIterator>
|
|
|
|
inline bool
|
|
|
|
__foreign_iterator(const _Safe_iterator<_Iterator, _Sequence>& __it,
|
2014-03-21 19:54:06 +01:00
|
|
|
_InputIterator __other, _InputIterator __other_end)
|
2013-08-01 21:54:46 +02:00
|
|
|
{
|
|
|
|
typedef typename std::__is_integer<_InputIterator>::__type _Integral;
|
2014-03-21 19:54:06 +01:00
|
|
|
return __foreign_iterator_aux(__it, __other, __other_end, _Integral());
|
2013-08-01 21:54:46 +02:00
|
|
|
}
|
|
|
|
|
2005-05-27 17:01:45 +02:00
|
|
|
// Can't check if an input iterator sequence is sorted, because we
|
|
|
|
// can't step through the sequence.
|
|
|
|
template<typename _InputIterator>
|
|
|
|
inline bool
|
|
|
|
__check_sorted_aux(const _InputIterator&, const _InputIterator&,
|
|
|
|
std::input_iterator_tag)
|
|
|
|
{ return true; }
|
|
|
|
|
|
|
|
// Can verify if a forward iterator sequence is in fact sorted using
|
|
|
|
// std::__is_sorted
|
|
|
|
template<typename _ForwardIterator>
|
|
|
|
inline bool
|
|
|
|
__check_sorted_aux(_ForwardIterator __first, _ForwardIterator __last,
|
|
|
|
std::forward_iterator_tag)
|
|
|
|
{
|
|
|
|
if (__first == __last)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
_ForwardIterator __next = __first;
|
2015-05-23 13:17:38 +02:00
|
|
|
for (++__next; __next != __last; __first = __next, (void)++__next)
|
2005-05-27 17:01:45 +02:00
|
|
|
if (*__next < *__first)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Can't check if an input iterator sequence is sorted, because we can't step
|
|
|
|
// through the sequence.
|
|
|
|
template<typename _InputIterator, typename _Predicate>
|
|
|
|
inline bool
|
|
|
|
__check_sorted_aux(const _InputIterator&, const _InputIterator&,
|
|
|
|
_Predicate, std::input_iterator_tag)
|
|
|
|
{ return true; }
|
|
|
|
|
|
|
|
// Can verify if a forward iterator sequence is in fact sorted using
|
|
|
|
// std::__is_sorted
|
|
|
|
template<typename _ForwardIterator, typename _Predicate>
|
|
|
|
inline bool
|
|
|
|
__check_sorted_aux(_ForwardIterator __first, _ForwardIterator __last,
|
|
|
|
_Predicate __pred, std::forward_iterator_tag)
|
|
|
|
{
|
|
|
|
if (__first == __last)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
_ForwardIterator __next = __first;
|
2015-05-23 13:17:38 +02:00
|
|
|
for (++__next; __next != __last; __first = __next, (void)++__next)
|
2005-05-27 17:01:45 +02:00
|
|
|
if (__pred(*__next, *__first))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Determine if a sequence is sorted.
|
|
|
|
template<typename _InputIterator>
|
|
|
|
inline bool
|
|
|
|
__check_sorted(const _InputIterator& __first, const _InputIterator& __last)
|
|
|
|
{
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
// Verify that the < operator for elements in the sequence is a
|
|
|
|
// StrictWeakOrdering by checking that it is irreflexive.
|
[multiple changes]
2010-08-29 Paolo Carlini <paolo.carlini@oracle.com>
* testsuite/23_containers/bitset/invalidation: Move...
* testsuite/23_containers/bitset/debug/invalidation: ... here.
* testsuite/23_containers/deque/invalidation: Move...
* testsuite/23_containers/deque/debug/invalidation: ... here.
* testsuite/23_containers/list/invalidation: Move...
* testsuite/23_containers/list/debug/invalidation: ... here.
* testsuite/23_containers/map/invalidation: Move...
* testsuite/23_containers/map/debug/invalidation: ... here.
* testsuite/23_containers/multimap/invalidation: Move...
* testsuite/23_containers/multimap/debug/invalidation: ... here.
* testsuite/23_containers/set/invalidation: Move...
* testsuite/23_containers/set/debug/invalidation: ... here.
* testsuite/23_containers/multiset/invalidation: Move...
* testsuite/23_containers/multiset/debug/invalidation: ... here.
* testsuite/23_containers/vector/invalidation: Move...
* testsuite/23_containers/vector/debug/invalidation: ... here.
2010-08-29 François Dumont <francois.cppdevs@free.fr>
* include/bits/stl_algobase.h (_Iter_base): Move...
* include/bits/stl_iterator_base_types.h: ...here.
* include/debug/functions.h (__check_valid_range, __check_string,
__check_sorted): Fix to not depend on _GLIBCXX_DEBUG; include
formatter.h and use formatting macros for a consistent debug result.
* include/debug/formatter.h (__check_singular): Declare; do not
include debug.h.
* include/debug/debug.h: Do not include formatter.h.
* include/debug/safe_iterator.h (_Safe_iterator::_Base_Iterator)
rename to iterator_type.
(__gnu_debug::__base): Add.
* include/debug/set.h: Use everywhere __gnu_debug::__base once
iterator range valided.
* include/debug/unordered_map: Likewise.
* include/debug/multiset.h: Likewise.
* include/debug/vector: Likewise.
* include/debug/unordered_set: Likewise.
* include/debug/deque: Likewise.
* include/debug/map.h: Likewise.
* include/debug/string: Likewise.
* include/debug/list: Likewise.
* include/debug/multimap.h: Likewise.
* testsuite/23_containers/util/debug/assign_neg.h: New test cases on
debug checks performed on container assign operation.
* testsuite/23_containers/util/debug/construct_neg.h: New test cases
on debug checks on constructors.
* testsuite/23_containers/util/debug/insert_neg.h: New test cases on
debug checks performed on container insert operations.
* testsuite/23_containers/unordered_map/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: New.
* testsuite/23_containers/multimap/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/set/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/unordered_multimap/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/unordered_set/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/multiset/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/unordered_multiset/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/map/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/vector/debug/cont_traits.h,
debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc,
assign4_neg.cc, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/deque/debug/cont_traits.h,
debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc,
assign4_neg.cc, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/list/debug/cont_traits.h,
debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc,
assign4_neg.cc, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/performance/23_containers/range_construct/
list_construct1.cc: New, validate performance impact of the patch
on the debug mode.
* testsuite/performance/23_containers/range_construct/
list_construct2.cc: Likewise.
* testsuite/performance/23_containers/range_construct/
vector_construct.cc: Likewise.
* testsuite/performance/23_containers/range_construct/
deque_construct.cc: Likewise.
From-SVN: r163628
2010-08-29 19:39:00 +02:00
|
|
|
__glibcxx_assert(__first == __last || !(*__first < *__first));
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
|
2012-05-11 21:21:31 +02:00
|
|
|
return __check_sorted_aux(__first, __last,
|
|
|
|
std::__iterator_category(__first));
|
2005-05-27 17:01:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template<typename _InputIterator, typename _Predicate>
|
|
|
|
inline bool
|
|
|
|
__check_sorted(const _InputIterator& __first, const _InputIterator& __last,
|
|
|
|
_Predicate __pred)
|
|
|
|
{
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
// Verify that the predicate is StrictWeakOrdering by checking that it
|
|
|
|
// is irreflexive.
|
[multiple changes]
2010-08-29 Paolo Carlini <paolo.carlini@oracle.com>
* testsuite/23_containers/bitset/invalidation: Move...
* testsuite/23_containers/bitset/debug/invalidation: ... here.
* testsuite/23_containers/deque/invalidation: Move...
* testsuite/23_containers/deque/debug/invalidation: ... here.
* testsuite/23_containers/list/invalidation: Move...
* testsuite/23_containers/list/debug/invalidation: ... here.
* testsuite/23_containers/map/invalidation: Move...
* testsuite/23_containers/map/debug/invalidation: ... here.
* testsuite/23_containers/multimap/invalidation: Move...
* testsuite/23_containers/multimap/debug/invalidation: ... here.
* testsuite/23_containers/set/invalidation: Move...
* testsuite/23_containers/set/debug/invalidation: ... here.
* testsuite/23_containers/multiset/invalidation: Move...
* testsuite/23_containers/multiset/debug/invalidation: ... here.
* testsuite/23_containers/vector/invalidation: Move...
* testsuite/23_containers/vector/debug/invalidation: ... here.
2010-08-29 François Dumont <francois.cppdevs@free.fr>
* include/bits/stl_algobase.h (_Iter_base): Move...
* include/bits/stl_iterator_base_types.h: ...here.
* include/debug/functions.h (__check_valid_range, __check_string,
__check_sorted): Fix to not depend on _GLIBCXX_DEBUG; include
formatter.h and use formatting macros for a consistent debug result.
* include/debug/formatter.h (__check_singular): Declare; do not
include debug.h.
* include/debug/debug.h: Do not include formatter.h.
* include/debug/safe_iterator.h (_Safe_iterator::_Base_Iterator)
rename to iterator_type.
(__gnu_debug::__base): Add.
* include/debug/set.h: Use everywhere __gnu_debug::__base once
iterator range valided.
* include/debug/unordered_map: Likewise.
* include/debug/multiset.h: Likewise.
* include/debug/vector: Likewise.
* include/debug/unordered_set: Likewise.
* include/debug/deque: Likewise.
* include/debug/map.h: Likewise.
* include/debug/string: Likewise.
* include/debug/list: Likewise.
* include/debug/multimap.h: Likewise.
* testsuite/23_containers/util/debug/assign_neg.h: New test cases on
debug checks performed on container assign operation.
* testsuite/23_containers/util/debug/construct_neg.h: New test cases
on debug checks on constructors.
* testsuite/23_containers/util/debug/insert_neg.h: New test cases on
debug checks performed on container insert operations.
* testsuite/23_containers/unordered_map/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: New.
* testsuite/23_containers/multimap/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/set/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/unordered_multimap/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/unordered_set/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/multiset/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/unordered_multiset/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/map/debug/cont_traits.h,
debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/vector/debug/cont_traits.h,
debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc,
assign4_neg.cc, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/deque/debug/cont_traits.h,
debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc,
assign4_neg.cc, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/23_containers/list/debug/cont_traits.h,
debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc,
assign4_neg.cc, construct1_neg.cc, construct2_neg.cc,
construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc,
insert3_neg.cc, insert4_neg.cc: Likewise.
* testsuite/performance/23_containers/range_construct/
list_construct1.cc: New, validate performance impact of the patch
on the debug mode.
* testsuite/performance/23_containers/range_construct/
list_construct2.cc: Likewise.
* testsuite/performance/23_containers/range_construct/
vector_construct.cc: Likewise.
* testsuite/performance/23_containers/range_construct/
deque_construct.cc: Likewise.
From-SVN: r163628
2010-08-29 19:39:00 +02:00
|
|
|
__glibcxx_assert(__first == __last || !__pred(*__first, *__first));
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
|
2012-05-11 21:21:31 +02:00
|
|
|
return __check_sorted_aux(__first, __last, __pred,
|
|
|
|
std::__iterator_category(__first));
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
}
|
|
|
|
|
2008-03-13 18:35:40 +01:00
|
|
|
template<typename _InputIterator>
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
inline bool
|
2008-03-13 18:35:40 +01:00
|
|
|
__check_sorted_set_aux(const _InputIterator& __first,
|
|
|
|
const _InputIterator& __last,
|
|
|
|
std::__true_type)
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
{ return __check_sorted(__first, __last); }
|
|
|
|
|
2008-03-13 18:35:40 +01:00
|
|
|
template<typename _InputIterator>
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
inline bool
|
2008-03-13 18:35:40 +01:00
|
|
|
__check_sorted_set_aux(const _InputIterator&,
|
|
|
|
const _InputIterator&,
|
|
|
|
std::__false_type)
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
{ return true; }
|
|
|
|
|
2008-03-13 18:35:40 +01:00
|
|
|
template<typename _InputIterator, typename _Predicate>
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
inline bool
|
2008-03-13 18:35:40 +01:00
|
|
|
__check_sorted_set_aux(const _InputIterator& __first,
|
|
|
|
const _InputIterator& __last,
|
|
|
|
_Predicate __pred, std::__true_type)
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
{ return __check_sorted(__first, __last, __pred); }
|
|
|
|
|
2008-03-13 18:35:40 +01:00
|
|
|
template<typename _InputIterator, typename _Predicate>
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
inline bool
|
2008-03-13 18:35:40 +01:00
|
|
|
__check_sorted_set_aux(const _InputIterator&,
|
|
|
|
const _InputIterator&, _Predicate,
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
std::__false_type)
|
|
|
|
{ return true; }
|
|
|
|
|
|
|
|
// ... special variant used in std::merge, std::includes, std::set_*.
|
|
|
|
template<typename _InputIterator1, typename _InputIterator2>
|
|
|
|
inline bool
|
|
|
|
__check_sorted_set(const _InputIterator1& __first,
|
|
|
|
const _InputIterator1& __last,
|
|
|
|
const _InputIterator2&)
|
|
|
|
{
|
|
|
|
typedef typename std::iterator_traits<_InputIterator1>::value_type
|
|
|
|
_ValueType1;
|
|
|
|
typedef typename std::iterator_traits<_InputIterator2>::value_type
|
|
|
|
_ValueType2;
|
|
|
|
|
|
|
|
typedef typename std::__are_same<_ValueType1, _ValueType2>::__type
|
|
|
|
_SameType;
|
|
|
|
return __check_sorted_set_aux(__first, __last, _SameType());
|
2005-05-27 17:01:45 +02:00
|
|
|
}
|
|
|
|
|
re PR libstdc++/34730 (Legal program doesn't compile with -D_GLIBCXX_DEBUG)
2008-01-12 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34730
* include/debug/functions.h (__check_sorted_set,
__check_sorted_set_aux): Add.
(__check_sorted): Check StrictWeakOrdering.
* include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
__glibcxx_check_strict_weak_ordering_pred): Remove.
(__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
(__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
* include/debug/debug.h (__glibcxx_requires_sorted_set,
__glibcxx_requires_sorted_set_pred): Add.
* include/bits/stl_algo.h (merge, includes, set_union,
set_intersection, set_difference, set_symmetric_difference):
Adjust, use __glibcxx_requires_sorted_set* instead.
* testsuite/25_algorithms/set_intersection/34730.cc: New.
From-SVN: r131500
2008-01-13 02:34:58 +01:00
|
|
|
template<typename _InputIterator1, typename _InputIterator2,
|
|
|
|
typename _Predicate>
|
|
|
|
inline bool
|
|
|
|
__check_sorted_set(const _InputIterator1& __first,
|
|
|
|
const _InputIterator1& __last,
|
|
|
|
const _InputIterator2&, _Predicate __pred)
|
|
|
|
{
|
|
|
|
typedef typename std::iterator_traits<_InputIterator1>::value_type
|
|
|
|
_ValueType1;
|
|
|
|
typedef typename std::iterator_traits<_InputIterator2>::value_type
|
|
|
|
_ValueType2;
|
|
|
|
|
|
|
|
typedef typename std::__are_same<_ValueType1, _ValueType2>::__type
|
|
|
|
_SameType;
|
|
|
|
return __check_sorted_set_aux(__first, __last, __pred, _SameType());
|
|
|
|
}
|
|
|
|
|
2013-08-30 22:16:03 +02:00
|
|
|
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
|
|
|
// 270. Binary search requirements overly strict
|
|
|
|
// Determine if a sequence is partitioned w.r.t. this element.
|
2005-05-27 17:01:45 +02:00
|
|
|
template<typename _ForwardIterator, typename _Tp>
|
|
|
|
inline bool
|
2013-08-30 22:16:03 +02:00
|
|
|
__check_partitioned_lower(_ForwardIterator __first,
|
|
|
|
_ForwardIterator __last, const _Tp& __value)
|
2005-05-27 17:01:45 +02:00
|
|
|
{
|
|
|
|
while (__first != __last && *__first < __value)
|
|
|
|
++__first;
|
2012-08-03 21:34:49 +02:00
|
|
|
if (__first != __last)
|
|
|
|
{
|
|
|
|
++__first;
|
|
|
|
while (__first != __last && !(*__first < __value))
|
|
|
|
++__first;
|
|
|
|
}
|
2005-05-27 17:01:45 +02:00
|
|
|
return __first == __last;
|
|
|
|
}
|
|
|
|
|
2007-10-03 02:34:40 +02:00
|
|
|
template<typename _ForwardIterator, typename _Tp>
|
|
|
|
inline bool
|
2013-08-30 22:16:03 +02:00
|
|
|
__check_partitioned_upper(_ForwardIterator __first,
|
2007-10-03 02:34:40 +02:00
|
|
|
_ForwardIterator __last, const _Tp& __value)
|
|
|
|
{
|
|
|
|
while (__first != __last && !(__value < *__first))
|
|
|
|
++__first;
|
2012-08-03 21:34:49 +02:00
|
|
|
if (__first != __last)
|
|
|
|
{
|
|
|
|
++__first;
|
|
|
|
while (__first != __last && __value < *__first)
|
|
|
|
++__first;
|
|
|
|
}
|
2007-10-03 02:34:40 +02:00
|
|
|
return __first == __last;
|
|
|
|
}
|
|
|
|
|
2013-08-30 22:16:03 +02:00
|
|
|
// Determine if a sequence is partitioned w.r.t. this element.
|
2005-05-27 17:01:45 +02:00
|
|
|
template<typename _ForwardIterator, typename _Tp, typename _Pred>
|
|
|
|
inline bool
|
2013-08-30 22:16:03 +02:00
|
|
|
__check_partitioned_lower(_ForwardIterator __first,
|
|
|
|
_ForwardIterator __last, const _Tp& __value,
|
|
|
|
_Pred __pred)
|
2007-10-03 02:34:40 +02:00
|
|
|
{
|
|
|
|
while (__first != __last && bool(__pred(*__first, __value)))
|
|
|
|
++__first;
|
2012-08-03 21:34:49 +02:00
|
|
|
if (__first != __last)
|
|
|
|
{
|
|
|
|
++__first;
|
|
|
|
while (__first != __last && !bool(__pred(*__first, __value)))
|
|
|
|
++__first;
|
|
|
|
}
|
2007-10-03 02:34:40 +02:00
|
|
|
return __first == __last;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename _ForwardIterator, typename _Tp, typename _Pred>
|
|
|
|
inline bool
|
2013-08-30 22:16:03 +02:00
|
|
|
__check_partitioned_upper(_ForwardIterator __first,
|
2007-10-03 02:34:40 +02:00
|
|
|
_ForwardIterator __last, const _Tp& __value,
|
|
|
|
_Pred __pred)
|
2005-05-27 17:01:45 +02:00
|
|
|
{
|
2007-10-03 02:34:40 +02:00
|
|
|
while (__first != __last && !bool(__pred(__value, *__first)))
|
2005-05-27 17:01:45 +02:00
|
|
|
++__first;
|
2012-08-03 21:34:49 +02:00
|
|
|
if (__first != __last)
|
|
|
|
{
|
|
|
|
++__first;
|
|
|
|
while (__first != __last && bool(__pred(__value, *__first)))
|
|
|
|
++__first;
|
|
|
|
}
|
2005-05-27 17:01:45 +02:00
|
|
|
return __first == __last;
|
|
|
|
}
|
2012-05-11 21:21:31 +02:00
|
|
|
|
2015-08-25 22:27:03 +02:00
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
struct _Irreflexive_checker
|
|
|
|
{
|
|
|
|
template<typename _It>
|
|
|
|
static typename std::iterator_traits<_It>::reference
|
|
|
|
__deref();
|
|
|
|
|
|
|
|
template<typename _It,
|
|
|
|
typename = decltype(__deref<_It>() < __deref<_It>())>
|
|
|
|
static bool
|
|
|
|
_S_is_valid(_It __it)
|
|
|
|
{ return !(*__it < *__it); }
|
|
|
|
|
|
|
|
// Fallback method if operator doesn't exist.
|
|
|
|
template<typename... _Args>
|
|
|
|
static bool
|
|
|
|
_S_is_valid(_Args...)
|
|
|
|
{ return true; }
|
|
|
|
|
|
|
|
template<typename _It, typename _Pred, typename
|
|
|
|
= decltype(std::declval<_Pred>()(__deref<_It>(), __deref<_It>()))>
|
|
|
|
static bool
|
|
|
|
_S_is_valid_pred(_It __it, _Pred __pred)
|
|
|
|
{ return !__pred(*__it, *__it); }
|
|
|
|
|
|
|
|
// Fallback method if predicate can't be invoked.
|
|
|
|
template<typename... _Args>
|
|
|
|
static bool
|
|
|
|
_S_is_valid_pred(_Args...)
|
|
|
|
{ return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
template<typename _Iterator>
|
|
|
|
inline bool
|
|
|
|
__is_irreflexive(_Iterator __it)
|
|
|
|
{ return _Irreflexive_checker::_S_is_valid(__it); }
|
|
|
|
|
|
|
|
template<typename _Iterator, typename _Pred>
|
|
|
|
inline bool
|
|
|
|
__is_irreflexive_pred(_Iterator __it, _Pred __pred)
|
|
|
|
{ return _Irreflexive_checker::_S_is_valid_pred(__it, __pred); }
|
|
|
|
#endif
|
|
|
|
|
2005-05-27 17:01:45 +02:00
|
|
|
} // namespace __gnu_debug
|
|
|
|
|
|
|
|
#endif
|