@@ -175,62 +175,6 @@
return __first;
}
-#if __cplusplus >= 201103L
- // Default implementation.
- template<typename _Iterator, typename _Sequence>
- inline bool
- __foreign_iterator_aux4(const _Safe_iterator<_Iterator, _Sequence>& __it,
- typename _Sequence::const_pointer __begin,
- typename _Sequence::const_pointer __other)
- {
- typedef typename _Sequence::const_pointer _PointerType;
- constexpr std::less<_PointerType> __l{};
-
- return (__l(__other, __begin)
- || __l(std::addressof(*(__it._M_get_sequence()->_M_base().end()
- - 1)), __other));
- }
-
- // Fallback when address type cannot be implicitely casted to sequence
- // const_pointer.
- template<typename _Iterator, typename _Sequence,
- typename _InputIterator>
- inline bool
- __foreign_iterator_aux4(const _Safe_iterator<_Iterator, _Sequence>&,
- _InputIterator, ...)
- { return true; }
-
- template<typename _Iterator, typename _Sequence, typename _InputIterator>
- inline bool
- __foreign_iterator_aux3(const _Safe_iterator<_Iterator, _Sequence>& __it,
- _InputIterator __other,
- std::true_type)
- {
- // Only containers with all elements in contiguous memory can have their
- // elements passed through pointers.
- // Arithmetics is here just to make sure we are not dereferencing
- // past-the-end iterator.
- if (__it._M_get_sequence()->_M_base().begin()
- != __it._M_get_sequence()->_M_base().end())
- if (std::addressof(*(__it._M_get_sequence()->_M_base().end() - 1))
- - std::addressof(*(__it._M_get_sequence()->_M_base().begin()))
- == __it._M_get_sequence()->size() - 1)
- return (__foreign_iterator_aux4
- (__it,
- std::addressof(*(__it._M_get_sequence()->_M_base().begin())),
- std::addressof(*__other)));
- return true;
- }
-
- /* Fallback overload for which we can't say, assume it is valid. */
- template<typename _Iterator, typename _Sequence, typename _InputIterator>
- inline bool
- __foreign_iterator_aux3(const _Safe_iterator<_Iterator, _Sequence>& __it,
- _InputIterator __other,
- std::false_type)
- { return true; }
-#endif
-
/** Checks that iterators do not belong to the same sequence. */
template<typename _Iterator, typename _Sequence, typename _OtherIterator>
inline bool
@@ -238,29 +182,12 @@
const _Safe_iterator<_OtherIterator, _Sequence>& __other,
std::input_iterator_tag)
{ return __it._M_get_sequence() != __other._M_get_sequence(); }
-
-#if __cplusplus >= 201103L
- /* This overload detects when passing pointers to the contained elements
- rather than using iterators.
- */
- template<typename _Iterator, typename _Sequence, typename _InputIterator>
- inline bool
- __foreign_iterator_aux2(const _Safe_iterator<_Iterator, _Sequence>& __it,
- _InputIterator __other,
- std::random_access_iterator_tag)
- {
- typedef typename _Sequence::const_iterator _ItType;
- typedef typename std::iterator_traits<_ItType>::reference _Ref;
- return __foreign_iterator_aux3(__it, __other,
- std::is_lvalue_reference<_Ref>());
- }
-#endif
-
+
/* Fallback overload for which we can't say, assume it is valid. */
template<typename _Iterator, typename _Sequence, typename _InputIterator>
inline bool
__foreign_iterator_aux2(const _Safe_iterator<_Iterator, _Sequence>&,
- _InputIterator,
+ const _InputIterator&,
std::input_iterator_tag)
{ return true; }