Vendor import of libc++ trunk r303291:
https://llvm.org/svn/llvm-project/libcxx/trunk@303291
This commit is contained in:
parent
7582e3938b
commit
318f9824bd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/libc++/dist/; revision=318420 svn path=/vendor/libc++/libc++-trunk-r303291/; revision=318421; tag=vendor/libc++/libc++-trunk-r303291
@ -64,14 +64,23 @@ struct forward_iterator_tag : public input_iterator_tag {};
|
||||
struct bidirectional_iterator_tag : public forward_iterator_tag {};
|
||||
struct random_access_iterator_tag : public bidirectional_iterator_tag {};
|
||||
|
||||
// 27.4.3, iterator operations
|
||||
// extension: second argument not conforming to C++03
|
||||
template <class InputIterator>
|
||||
void advance(InputIterator& i,
|
||||
template <class InputIterator> // constexpr in C++17
|
||||
constexpr void advance(InputIterator& i,
|
||||
typename iterator_traits<InputIterator>::difference_type n);
|
||||
|
||||
template <class InputIterator>
|
||||
typename iterator_traits<InputIterator>::difference_type
|
||||
distance(InputIterator first, InputIterator last);
|
||||
template <class InputIterator> // constexpr in C++17
|
||||
constexpr typename iterator_traits<InputIterator>::difference_type
|
||||
distance(InputIterator first, InputIterator last);
|
||||
|
||||
template <class InputIterator> // constexpr in C++17
|
||||
constexpr InputIterator next(InputIterator x,
|
||||
typename iterator_traits<InputIterator>::difference_type n = 1);
|
||||
|
||||
template <class BidirectionalIterator> // constexpr in C++17
|
||||
constexpr BidirectionalIterator prev(BidirectionalIterator x,
|
||||
typename iterator_traits<BidirectionalIterator>::difference_type n = 1);
|
||||
|
||||
template <class Iterator>
|
||||
class reverse_iterator
|
||||
@ -529,7 +538,7 @@ struct _LIBCPP_TEMPLATE_VIS iterator
|
||||
};
|
||||
|
||||
template <class _InputIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||
void __advance(_InputIter& __i,
|
||||
typename iterator_traits<_InputIter>::difference_type __n, input_iterator_tag)
|
||||
{
|
||||
@ -538,7 +547,7 @@ void __advance(_InputIter& __i,
|
||||
}
|
||||
|
||||
template <class _BiDirIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||
void __advance(_BiDirIter& __i,
|
||||
typename iterator_traits<_BiDirIter>::difference_type __n, bidirectional_iterator_tag)
|
||||
{
|
||||
@ -551,7 +560,7 @@ void __advance(_BiDirIter& __i,
|
||||
}
|
||||
|
||||
template <class _RandIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||
void __advance(_RandIter& __i,
|
||||
typename iterator_traits<_RandIter>::difference_type __n, random_access_iterator_tag)
|
||||
{
|
||||
@ -559,7 +568,7 @@ void __advance(_RandIter& __i,
|
||||
}
|
||||
|
||||
template <class _InputIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||
void advance(_InputIter& __i,
|
||||
typename iterator_traits<_InputIter>::difference_type __n)
|
||||
{
|
||||
@ -567,7 +576,7 @@ void advance(_InputIter& __i,
|
||||
}
|
||||
|
||||
template <class _InputIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||
typename iterator_traits<_InputIter>::difference_type
|
||||
__distance(_InputIter __first, _InputIter __last, input_iterator_tag)
|
||||
{
|
||||
@ -578,7 +587,7 @@ __distance(_InputIter __first, _InputIter __last, input_iterator_tag)
|
||||
}
|
||||
|
||||
template <class _RandIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||
typename iterator_traits<_RandIter>::difference_type
|
||||
__distance(_RandIter __first, _RandIter __last, random_access_iterator_tag)
|
||||
{
|
||||
@ -586,7 +595,7 @@ __distance(_RandIter __first, _RandIter __last, random_access_iterator_tag)
|
||||
}
|
||||
|
||||
template <class _InputIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||
typename iterator_traits<_InputIter>::difference_type
|
||||
distance(_InputIter __first, _InputIter __last)
|
||||
{
|
||||
@ -594,7 +603,7 @@ distance(_InputIter __first, _InputIter __last)
|
||||
}
|
||||
|
||||
template <class _InputIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||
_InputIter
|
||||
next(_InputIter __x,
|
||||
typename iterator_traits<_InputIter>::difference_type __n = 1,
|
||||
@ -605,7 +614,7 @@ next(_InputIter __x,
|
||||
}
|
||||
|
||||
template <class _BidiretionalIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||
_BidiretionalIter
|
||||
prev(_BidiretionalIter __x,
|
||||
typename iterator_traits<_BidiretionalIter>::difference_type __n = 1,
|
||||
|
@ -599,8 +599,8 @@ private:
|
||||
public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr optional() noexcept {}
|
||||
_LIBCPP_INLINE_VISIBILITY optional(const optional&) = default;
|
||||
_LIBCPP_INLINE_VISIBILITY optional(optional&&) = default;
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr optional(const optional&) = default;
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr optional(optional&&) = default;
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr optional(nullopt_t) noexcept {}
|
||||
|
||||
template <class... _Args, class = enable_if_t<
|
||||
|
@ -9,14 +9,16 @@
|
||||
|
||||
// <iterator>
|
||||
|
||||
// All of these became constexpr in C++17
|
||||
//
|
||||
// template <InputIterator Iter>
|
||||
// void advance(Iter& i, Iter::difference_type n);
|
||||
// constexpr void advance(Iter& i, Iter::difference_type n);
|
||||
//
|
||||
// template <BidirectionalIterator Iter>
|
||||
// void advance(Iter& i, Iter::difference_type n);
|
||||
// constexpr void advance(Iter& i, Iter::difference_type n);
|
||||
//
|
||||
// template <RandomAccessIterator Iter>
|
||||
// void advance(Iter& i, Iter::difference_type n);
|
||||
// constexpr void advance(Iter& i, Iter::difference_type n);
|
||||
|
||||
#include <iterator>
|
||||
#include <cassert>
|
||||
@ -31,8 +33,19 @@ test(It i, typename std::iterator_traits<It>::difference_type n, It x)
|
||||
assert(i == x);
|
||||
}
|
||||
|
||||
#if TEST_STD_VER > 14
|
||||
template <class It>
|
||||
constexpr bool
|
||||
constepxr_test(It i, typename std::iterator_traits<It>::difference_type n, It x)
|
||||
{
|
||||
std::advance(i, n);
|
||||
return i == x;
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
const char* s = "1234567890";
|
||||
test(input_iterator<const char*>(s), 10, input_iterator<const char*>(s+10));
|
||||
test(forward_iterator<const char*>(s), 10, forward_iterator<const char*>(s+10));
|
||||
@ -42,4 +55,18 @@ int main()
|
||||
test(random_access_iterator<const char*>(s+5), -5, random_access_iterator<const char*>(s));
|
||||
test(s+5, 5, s+10);
|
||||
test(s+5, -5, s);
|
||||
}
|
||||
#if TEST_STD_VER > 14
|
||||
{
|
||||
constexpr const char* s = "1234567890";
|
||||
static_assert( constepxr_test(input_iterator<const char*>(s), 10, input_iterator<const char*>(s+10)), "" );
|
||||
static_assert( constepxr_test(forward_iterator<const char*>(s), 10, forward_iterator<const char*>(s+10)), "" );
|
||||
static_assert( constepxr_test(bidirectional_iterator<const char*>(s+5), 5, bidirectional_iterator<const char*>(s+10)), "" );
|
||||
static_assert( constepxr_test(bidirectional_iterator<const char*>(s+5), -5, bidirectional_iterator<const char*>(s)), "" );
|
||||
static_assert( constepxr_test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s+10)), "" );
|
||||
static_assert( constepxr_test(random_access_iterator<const char*>(s+5), -5, random_access_iterator<const char*>(s)), "" );
|
||||
static_assert( constepxr_test(s+5, 5, s+10), "" );
|
||||
static_assert( constepxr_test(s+5, -5, s), "" );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -29,12 +29,33 @@ test(It first, It last, typename std::iterator_traits<It>::difference_type x)
|
||||
assert(std::distance(first, last) == x);
|
||||
}
|
||||
|
||||
#if TEST_STD_VER > 14
|
||||
template <class It>
|
||||
constexpr bool
|
||||
constexpr_test(It first, It last, typename std::iterator_traits<It>::difference_type x)
|
||||
{
|
||||
return std::distance(first, last) == x;
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
const char* s = "1234567890";
|
||||
test(input_iterator<const char*>(s), input_iterator<const char*>(s+10), 10);
|
||||
test(forward_iterator<const char*>(s), forward_iterator<const char*>(s+10), 10);
|
||||
test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s+10), 10);
|
||||
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+10), 10);
|
||||
test(s, s+10, 10);
|
||||
}
|
||||
#if TEST_STD_VER > 14
|
||||
{
|
||||
constexpr const char* s = "1234567890";
|
||||
static_assert( constexpr_test(input_iterator<const char*>(s), input_iterator<const char*>(s+10), 10), "");
|
||||
static_assert( constexpr_test(forward_iterator<const char*>(s), forward_iterator<const char*>(s+10), 10), "");
|
||||
static_assert( constexpr_test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s+10), 10), "");
|
||||
static_assert( constexpr_test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+10), 10), "");
|
||||
static_assert( constexpr_test(s, s+10, 10), "");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -33,8 +33,25 @@ test(It i, It x)
|
||||
assert(std::next(i) == x);
|
||||
}
|
||||
|
||||
#if TEST_STD_VER > 14
|
||||
template <class It>
|
||||
constexpr bool
|
||||
constexpr_test(It i, typename std::iterator_traits<It>::difference_type n, It x)
|
||||
{
|
||||
return std::next(i, n) == x;
|
||||
}
|
||||
|
||||
template <class It>
|
||||
constexpr bool
|
||||
constexpr_test(It i, It x)
|
||||
{
|
||||
return std::next(i) == x;
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
const char* s = "1234567890";
|
||||
test(input_iterator<const char*>(s), 10, input_iterator<const char*>(s+10));
|
||||
test(forward_iterator<const char*>(s), 10, forward_iterator<const char*>(s+10));
|
||||
@ -47,4 +64,21 @@ int main()
|
||||
test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s+1));
|
||||
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1));
|
||||
test(s, s+1);
|
||||
}
|
||||
#if TEST_STD_VER > 14
|
||||
{
|
||||
constexpr const char* s = "1234567890";
|
||||
static_assert( constexpr_test(input_iterator<const char*>(s), 10, input_iterator<const char*>(s+10)), "" );
|
||||
static_assert( constexpr_test(forward_iterator<const char*>(s), 10, forward_iterator<const char*>(s+10)), "" );
|
||||
static_assert( constexpr_test(bidirectional_iterator<const char*>(s), 10, bidirectional_iterator<const char*>(s+10)), "" );
|
||||
static_assert( constexpr_test(random_access_iterator<const char*>(s), 10, random_access_iterator<const char*>(s+10)), "" );
|
||||
static_assert( constexpr_test(s, 10, s+10), "" );
|
||||
|
||||
static_assert( constexpr_test(input_iterator<const char*>(s), input_iterator<const char*>(s+1)), "" );
|
||||
static_assert( constexpr_test(forward_iterator<const char*>(s), forward_iterator<const char*>(s+1)), "" );
|
||||
static_assert( constexpr_test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s+1)), "" );
|
||||
static_assert( constexpr_test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1)), "" );
|
||||
static_assert( constexpr_test(s, s+1), "" );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -31,8 +31,25 @@ test(It i, It x)
|
||||
assert(std::prev(i) == x);
|
||||
}
|
||||
|
||||
#if TEST_STD_VER > 14
|
||||
template <class It>
|
||||
constexpr bool
|
||||
constexpr_test(It i, typename std::iterator_traits<It>::difference_type n, It x)
|
||||
{
|
||||
return std::prev(i, n) == x;
|
||||
}
|
||||
|
||||
template <class It>
|
||||
constexpr bool
|
||||
constexpr_test(It i, It x)
|
||||
{
|
||||
return std::prev(i) == x;
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
const char* s = "1234567890";
|
||||
test(bidirectional_iterator<const char*>(s+10), 10, bidirectional_iterator<const char*>(s));
|
||||
test(random_access_iterator<const char*>(s+10), 10, random_access_iterator<const char*>(s));
|
||||
@ -41,4 +58,18 @@ int main()
|
||||
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s));
|
||||
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s));
|
||||
test(s+1, s);
|
||||
}
|
||||
#if TEST_STD_VER > 14
|
||||
{
|
||||
constexpr const char* s = "1234567890";
|
||||
static_assert( constexpr_test(bidirectional_iterator<const char*>(s+10), 10, bidirectional_iterator<const char*>(s)), "" );
|
||||
static_assert( constexpr_test(random_access_iterator<const char*>(s+10), 10, random_access_iterator<const char*>(s)), "" );
|
||||
static_assert( constexpr_test(s+10, 10, s), "" );
|
||||
|
||||
static_assert( constexpr_test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s)), "" );
|
||||
static_assert( constexpr_test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s)), "" );
|
||||
static_assert( constexpr_test(s+1, s), "" );
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
// <optional>
|
||||
|
||||
// optional(const optional<T>& rhs);
|
||||
// constexpr optional(const optional<T>& rhs);
|
||||
|
||||
#include <optional>
|
||||
#include <type_traits>
|
||||
@ -152,4 +152,9 @@ int main()
|
||||
{
|
||||
test_reference_extension();
|
||||
}
|
||||
{
|
||||
constexpr std::optional<int> o1{4};
|
||||
constexpr std::optional<int> o2 = o1;
|
||||
static_assert( *o2 == 4, "" );
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
// <optional>
|
||||
|
||||
// optional(optional<T>&& rhs);
|
||||
// constexpr optional(optional<T>&& rhs);
|
||||
|
||||
#include <optional>
|
||||
#include <type_traits>
|
||||
@ -206,4 +206,9 @@ int main()
|
||||
{
|
||||
test_reference_extension();
|
||||
}
|
||||
{
|
||||
constexpr std::optional<int> o1{4};
|
||||
constexpr std::optional<int> o2 = std::move(o1);
|
||||
static_assert( *o2 == 4, "" );
|
||||
}
|
||||
}
|
||||
|
@ -68,23 +68,23 @@ class input_iterator
|
||||
typedef It pointer;
|
||||
typedef typename Traits::reference reference;
|
||||
|
||||
It base() const {return it_;}
|
||||
TEST_CONSTEXPR_CXX14 It base() const {return it_;}
|
||||
|
||||
input_iterator() : it_() {}
|
||||
explicit input_iterator(It it) : it_(it) {}
|
||||
TEST_CONSTEXPR_CXX14 input_iterator() : it_() {}
|
||||
explicit TEST_CONSTEXPR_CXX14 input_iterator(It it) : it_(it) {}
|
||||
template <class U, class T>
|
||||
input_iterator(const input_iterator<U, T>& u) :it_(u.it_) {}
|
||||
TEST_CONSTEXPR_CXX14 input_iterator(const input_iterator<U, T>& u) :it_(u.it_) {}
|
||||
|
||||
reference operator*() const {return *it_;}
|
||||
pointer operator->() const {return it_;}
|
||||
TEST_CONSTEXPR_CXX14 reference operator*() const {return *it_;}
|
||||
TEST_CONSTEXPR_CXX14 pointer operator->() const {return it_;}
|
||||
|
||||
input_iterator& operator++() {++it_; return *this;}
|
||||
input_iterator operator++(int)
|
||||
TEST_CONSTEXPR_CXX14 input_iterator& operator++() {++it_; return *this;}
|
||||
TEST_CONSTEXPR_CXX14 input_iterator operator++(int)
|
||||
{input_iterator tmp(*this); ++(*this); return tmp;}
|
||||
|
||||
friend bool operator==(const input_iterator& x, const input_iterator& y)
|
||||
friend TEST_CONSTEXPR_CXX14 bool operator==(const input_iterator& x, const input_iterator& y)
|
||||
{return x.it_ == y.it_;}
|
||||
friend bool operator!=(const input_iterator& x, const input_iterator& y)
|
||||
friend TEST_CONSTEXPR_CXX14 bool operator!=(const input_iterator& x, const input_iterator& y)
|
||||
{return !(x == y);}
|
||||
|
||||
template <class T>
|
||||
@ -120,23 +120,23 @@ class forward_iterator
|
||||
typedef It pointer;
|
||||
typedef typename std::iterator_traits<It>::reference reference;
|
||||
|
||||
It base() const {return it_;}
|
||||
TEST_CONSTEXPR_CXX14 It base() const {return it_;}
|
||||
|
||||
forward_iterator() : it_() {}
|
||||
explicit forward_iterator(It it) : it_(it) {}
|
||||
TEST_CONSTEXPR_CXX14 forward_iterator() : it_() {}
|
||||
explicit TEST_CONSTEXPR_CXX14 forward_iterator(It it) : it_(it) {}
|
||||
template <class U>
|
||||
forward_iterator(const forward_iterator<U>& u) :it_(u.it_) {}
|
||||
TEST_CONSTEXPR_CXX14 forward_iterator(const forward_iterator<U>& u) :it_(u.it_) {}
|
||||
|
||||
reference operator*() const {return *it_;}
|
||||
pointer operator->() const {return it_;}
|
||||
TEST_CONSTEXPR_CXX14 reference operator*() const {return *it_;}
|
||||
TEST_CONSTEXPR_CXX14 pointer operator->() const {return it_;}
|
||||
|
||||
forward_iterator& operator++() {++it_; return *this;}
|
||||
forward_iterator operator++(int)
|
||||
TEST_CONSTEXPR_CXX14 forward_iterator& operator++() {++it_; return *this;}
|
||||
TEST_CONSTEXPR_CXX14 forward_iterator operator++(int)
|
||||
{forward_iterator tmp(*this); ++(*this); return tmp;}
|
||||
|
||||
friend bool operator==(const forward_iterator& x, const forward_iterator& y)
|
||||
friend TEST_CONSTEXPR_CXX14 bool operator==(const forward_iterator& x, const forward_iterator& y)
|
||||
{return x.it_ == y.it_;}
|
||||
friend bool operator!=(const forward_iterator& x, const forward_iterator& y)
|
||||
friend TEST_CONSTEXPR_CXX14 bool operator!=(const forward_iterator& x, const forward_iterator& y)
|
||||
{return !(x == y);}
|
||||
|
||||
template <class T>
|
||||
@ -145,7 +145,7 @@ class forward_iterator
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
bool TEST_CONSTEXPR_CXX14
|
||||
operator==(const forward_iterator<T>& x, const forward_iterator<U>& y)
|
||||
{
|
||||
return x.base() == y.base();
|
||||
@ -153,7 +153,7 @@ operator==(const forward_iterator<T>& x, const forward_iterator<U>& y)
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
bool TEST_CONSTEXPR_CXX14
|
||||
operator!=(const forward_iterator<T>& x, const forward_iterator<U>& y)
|
||||
{
|
||||
return !(x == y);
|
||||
@ -172,22 +172,22 @@ class bidirectional_iterator
|
||||
typedef It pointer;
|
||||
typedef typename std::iterator_traits<It>::reference reference;
|
||||
|
||||
It base() const {return it_;}
|
||||
TEST_CONSTEXPR_CXX14 It base() const {return it_;}
|
||||
|
||||
bidirectional_iterator() : it_() {}
|
||||
explicit bidirectional_iterator(It it) : it_(it) {}
|
||||
TEST_CONSTEXPR_CXX14 bidirectional_iterator() : it_() {}
|
||||
explicit TEST_CONSTEXPR_CXX14 bidirectional_iterator(It it) : it_(it) {}
|
||||
template <class U>
|
||||
bidirectional_iterator(const bidirectional_iterator<U>& u) :it_(u.it_) {}
|
||||
TEST_CONSTEXPR_CXX14 bidirectional_iterator(const bidirectional_iterator<U>& u) :it_(u.it_) {}
|
||||
|
||||
reference operator*() const {return *it_;}
|
||||
pointer operator->() const {return it_;}
|
||||
TEST_CONSTEXPR_CXX14 reference operator*() const {return *it_;}
|
||||
TEST_CONSTEXPR_CXX14 pointer operator->() const {return it_;}
|
||||
|
||||
bidirectional_iterator& operator++() {++it_; return *this;}
|
||||
bidirectional_iterator operator++(int)
|
||||
TEST_CONSTEXPR_CXX14 bidirectional_iterator& operator++() {++it_; return *this;}
|
||||
TEST_CONSTEXPR_CXX14 bidirectional_iterator operator++(int)
|
||||
{bidirectional_iterator tmp(*this); ++(*this); return tmp;}
|
||||
|
||||
bidirectional_iterator& operator--() {--it_; return *this;}
|
||||
bidirectional_iterator operator--(int)
|
||||
TEST_CONSTEXPR_CXX14 bidirectional_iterator& operator--() {--it_; return *this;}
|
||||
TEST_CONSTEXPR_CXX14 bidirectional_iterator operator--(int)
|
||||
{bidirectional_iterator tmp(*this); --(*this); return tmp;}
|
||||
|
||||
template <class T>
|
||||
@ -196,7 +196,7 @@ class bidirectional_iterator
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
bool TEST_CONSTEXPR_CXX14
|
||||
operator==(const bidirectional_iterator<T>& x, const bidirectional_iterator<U>& y)
|
||||
{
|
||||
return x.base() == y.base();
|
||||
@ -204,7 +204,7 @@ operator==(const bidirectional_iterator<T>& x, const bidirectional_iterator<U>&
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
bool TEST_CONSTEXPR_CXX14
|
||||
operator!=(const bidirectional_iterator<T>& x, const bidirectional_iterator<U>& y)
|
||||
{
|
||||
return !(x == y);
|
||||
@ -223,34 +223,34 @@ class random_access_iterator
|
||||
typedef It pointer;
|
||||
typedef typename std::iterator_traits<It>::reference reference;
|
||||
|
||||
It base() const {return it_;}
|
||||
TEST_CONSTEXPR_CXX14 It base() const {return it_;}
|
||||
|
||||
random_access_iterator() : it_() {}
|
||||
explicit random_access_iterator(It it) : it_(it) {}
|
||||
template <class U>
|
||||
random_access_iterator(const random_access_iterator<U>& u) :it_(u.it_) {}
|
||||
TEST_CONSTEXPR_CXX14 random_access_iterator() : it_() {}
|
||||
explicit TEST_CONSTEXPR_CXX14 random_access_iterator(It it) : it_(it) {}
|
||||
template <class U>
|
||||
TEST_CONSTEXPR_CXX14 random_access_iterator(const random_access_iterator<U>& u) :it_(u.it_) {}
|
||||
|
||||
reference operator*() const {return *it_;}
|
||||
pointer operator->() const {return it_;}
|
||||
TEST_CONSTEXPR_CXX14 reference operator*() const {return *it_;}
|
||||
TEST_CONSTEXPR_CXX14 pointer operator->() const {return it_;}
|
||||
|
||||
random_access_iterator& operator++() {++it_; return *this;}
|
||||
random_access_iterator operator++(int)
|
||||
TEST_CONSTEXPR_CXX14 random_access_iterator& operator++() {++it_; return *this;}
|
||||
TEST_CONSTEXPR_CXX14 random_access_iterator operator++(int)
|
||||
{random_access_iterator tmp(*this); ++(*this); return tmp;}
|
||||
|
||||
random_access_iterator& operator--() {--it_; return *this;}
|
||||
random_access_iterator operator--(int)
|
||||
TEST_CONSTEXPR_CXX14 random_access_iterator& operator--() {--it_; return *this;}
|
||||
TEST_CONSTEXPR_CXX14 random_access_iterator operator--(int)
|
||||
{random_access_iterator tmp(*this); --(*this); return tmp;}
|
||||
|
||||
random_access_iterator& operator+=(difference_type n) {it_ += n; return *this;}
|
||||
random_access_iterator operator+(difference_type n) const
|
||||
TEST_CONSTEXPR_CXX14 random_access_iterator& operator+=(difference_type n) {it_ += n; return *this;}
|
||||
TEST_CONSTEXPR_CXX14 random_access_iterator operator+(difference_type n) const
|
||||
{random_access_iterator tmp(*this); tmp += n; return tmp;}
|
||||
friend random_access_iterator operator+(difference_type n, random_access_iterator x)
|
||||
friend TEST_CONSTEXPR_CXX14 random_access_iterator operator+(difference_type n, random_access_iterator x)
|
||||
{x += n; return x;}
|
||||
random_access_iterator& operator-=(difference_type n) {return *this += -n;}
|
||||
random_access_iterator operator-(difference_type n) const
|
||||
TEST_CONSTEXPR_CXX14 random_access_iterator& operator-=(difference_type n) {return *this += -n;}
|
||||
TEST_CONSTEXPR_CXX14 random_access_iterator operator-(difference_type n) const
|
||||
{random_access_iterator tmp(*this); tmp -= n; return tmp;}
|
||||
|
||||
reference operator[](difference_type n) const {return it_[n];}
|
||||
TEST_CONSTEXPR_CXX14 reference operator[](difference_type n) const {return it_[n];}
|
||||
|
||||
template <class T>
|
||||
void operator,(T const &) DELETE_FUNCTION;
|
||||
@ -258,7 +258,7 @@ class random_access_iterator
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
bool TEST_CONSTEXPR_CXX14
|
||||
operator==(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
||||
{
|
||||
return x.base() == y.base();
|
||||
@ -266,7 +266,7 @@ operator==(const random_access_iterator<T>& x, const random_access_iterator<U>&
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
bool TEST_CONSTEXPR_CXX14
|
||||
operator!=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
||||
{
|
||||
return !(x == y);
|
||||
@ -274,7 +274,7 @@ operator!=(const random_access_iterator<T>& x, const random_access_iterator<U>&
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
bool TEST_CONSTEXPR_CXX14
|
||||
operator<(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
||||
{
|
||||
return x.base() < y.base();
|
||||
@ -282,7 +282,7 @@ operator<(const random_access_iterator<T>& x, const random_access_iterator<U>& y
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
bool TEST_CONSTEXPR_CXX14
|
||||
operator<=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
||||
{
|
||||
return !(y < x);
|
||||
@ -290,7 +290,7 @@ operator<=(const random_access_iterator<T>& x, const random_access_iterator<U>&
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
bool TEST_CONSTEXPR_CXX14
|
||||
operator>(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
||||
{
|
||||
return y < x;
|
||||
@ -298,14 +298,14 @@ operator>(const random_access_iterator<T>& x, const random_access_iterator<U>& y
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
bool TEST_CONSTEXPR_CXX14
|
||||
operator>=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
||||
{
|
||||
return !(x < y);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
inline TEST_CONSTEXPR_CXX14
|
||||
typename std::iterator_traits<T>::difference_type
|
||||
operator-(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
|
||||
{
|
||||
@ -313,22 +313,22 @@ operator-(const random_access_iterator<T>& x, const random_access_iterator<U>& y
|
||||
}
|
||||
|
||||
template <class Iter>
|
||||
inline Iter base(output_iterator<Iter> i) { return i.base(); }
|
||||
inline TEST_CONSTEXPR_CXX14 Iter base(output_iterator<Iter> i) { return i.base(); }
|
||||
|
||||
template <class Iter>
|
||||
inline Iter base(input_iterator<Iter> i) { return i.base(); }
|
||||
inline TEST_CONSTEXPR_CXX14 Iter base(input_iterator<Iter> i) { return i.base(); }
|
||||
|
||||
template <class Iter>
|
||||
inline Iter base(forward_iterator<Iter> i) { return i.base(); }
|
||||
inline TEST_CONSTEXPR_CXX14 Iter base(forward_iterator<Iter> i) { return i.base(); }
|
||||
|
||||
template <class Iter>
|
||||
inline Iter base(bidirectional_iterator<Iter> i) { return i.base(); }
|
||||
inline TEST_CONSTEXPR_CXX14 Iter base(bidirectional_iterator<Iter> i) { return i.base(); }
|
||||
|
||||
template <class Iter>
|
||||
inline Iter base(random_access_iterator<Iter> i) { return i.base(); }
|
||||
inline TEST_CONSTEXPR_CXX14 Iter base(random_access_iterator<Iter> i) { return i.base(); }
|
||||
|
||||
template <class Iter> // everything else
|
||||
inline Iter base(Iter i) { return i; }
|
||||
inline TEST_CONSTEXPR_CXX14 Iter base(Iter i) { return i; }
|
||||
|
||||
template <typename T>
|
||||
struct ThrowingIterator {
|
||||
|
Loading…
Reference in New Issue
Block a user