From owner-svn-src-vendor@freebsd.org Wed May 17 20:23:08 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1DA2D715E0; Wed, 17 May 2017 20:23:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82BB51E0A; Wed, 17 May 2017 20:23:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HKN7TV015578; Wed, 17 May 2017 20:23:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HKN6eg015568; Wed, 17 May 2017 20:23:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705172023.v4HKN6eg015568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 May 2017 20:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r318420 - in vendor/libc++/dist: include test/std/iterators/iterator.primitives/iterator.operations test/std/utilities/optional/optional.object/optional.object.ctor test/support X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 May 2017 20:23:09 -0000 Author: dim Date: Wed May 17 20:23:06 2017 New Revision: 318420 URL: https://svnweb.freebsd.org/changeset/base/318420 Log: Vendor import of libc++ trunk r303291: https://llvm.org/svn/llvm-project/libcxx/trunk@303291 Modified: vendor/libc++/dist/include/iterator vendor/libc++/dist/include/optional vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/distance.pass.cpp vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp vendor/libc++/dist/test/support/test_iterators.h Modified: vendor/libc++/dist/include/iterator ============================================================================== --- vendor/libc++/dist/include/iterator Wed May 17 20:23:03 2017 (r318419) +++ vendor/libc++/dist/include/iterator Wed May 17 20:23:06 2017 (r318420) @@ -64,14 +64,23 @@ struct forward_iterator_tag : publ 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 -void advance(InputIterator& i, +template // constexpr in C++17 + constexpr void advance(InputIterator& i, typename iterator_traits::difference_type n); -template -typename iterator_traits::difference_type -distance(InputIterator first, InputIterator last); +template // constexpr in C++17 + constexpr typename iterator_traits::difference_type + distance(InputIterator first, InputIterator last); + +template // constexpr in C++17 + constexpr InputIterator next(InputIterator x, +typename iterator_traits::difference_type n = 1); + +template // constexpr in C++17 + constexpr BidirectionalIterator prev(BidirectionalIterator x, + typename iterator_traits::difference_type n = 1); template class reverse_iterator @@ -529,7 +538,7 @@ struct _LIBCPP_TEMPLATE_VIS iterator }; template -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 -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 -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 -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 -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, _InputIte } template -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 } template -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 } template -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 -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 _BidiretionalIter prev(_BidiretionalIter __x, typename iterator_traits<_BidiretionalIter>::difference_type __n = 1, Modified: vendor/libc++/dist/include/optional ============================================================================== --- vendor/libc++/dist/include/optional Wed May 17 20:23:03 2017 (r318419) +++ vendor/libc++/dist/include/optional Wed May 17 20:23:06 2017 (r318420) @@ -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 +// All of these became constexpr in C++17 +// // template -// void advance(Iter& i, Iter::difference_type n); +// constexpr void advance(Iter& i, Iter::difference_type n); // // template -// void advance(Iter& i, Iter::difference_type n); +// constexpr void advance(Iter& i, Iter::difference_type n); // // template -// void advance(Iter& i, Iter::difference_type n); +// constexpr void advance(Iter& i, Iter::difference_type n); #include #include @@ -31,8 +33,19 @@ test(It i, typename std::iterator_traits assert(i == x); } +#if TEST_STD_VER > 14 +template +constexpr bool +constepxr_test(It i, typename std::iterator_traits::difference_type n, It x) +{ + std::advance(i, n); + return i == x; +} +#endif + int main() { + { const char* s = "1234567890"; test(input_iterator(s), 10, input_iterator(s+10)); test(forward_iterator(s), 10, forward_iterator(s+10)); @@ -42,4 +55,18 @@ int main() test(random_access_iterator(s+5), -5, random_access_iterator(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(s), 10, input_iterator(s+10)), "" ); + static_assert( constepxr_test(forward_iterator(s), 10, forward_iterator(s+10)), "" ); + static_assert( constepxr_test(bidirectional_iterator(s+5), 5, bidirectional_iterator(s+10)), "" ); + static_assert( constepxr_test(bidirectional_iterator(s+5), -5, bidirectional_iterator(s)), "" ); + static_assert( constepxr_test(random_access_iterator(s+5), 5, random_access_iterator(s+10)), "" ); + static_assert( constepxr_test(random_access_iterator(s+5), -5, random_access_iterator(s)), "" ); + static_assert( constepxr_test(s+5, 5, s+10), "" ); + static_assert( constepxr_test(s+5, -5, s), "" ); + } +#endif } Modified: vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/distance.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/distance.pass.cpp Wed May 17 20:23:03 2017 (r318419) +++ vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/distance.pass.cpp Wed May 17 20:23:06 2017 (r318420) @@ -29,12 +29,33 @@ test(It first, It last, typename std::it assert(std::distance(first, last) == x); } +#if TEST_STD_VER > 14 +template +constexpr bool +constexpr_test(It first, It last, typename std::iterator_traits::difference_type x) +{ + return std::distance(first, last) == x; +} +#endif + int main() { + { const char* s = "1234567890"; test(input_iterator(s), input_iterator(s+10), 10); test(forward_iterator(s), forward_iterator(s+10), 10); test(bidirectional_iterator(s), bidirectional_iterator(s+10), 10); test(random_access_iterator(s), random_access_iterator(s+10), 10); test(s, s+10, 10); + } +#if TEST_STD_VER > 14 + { + constexpr const char* s = "1234567890"; + static_assert( constexpr_test(input_iterator(s), input_iterator(s+10), 10), ""); + static_assert( constexpr_test(forward_iterator(s), forward_iterator(s+10), 10), ""); + static_assert( constexpr_test(bidirectional_iterator(s), bidirectional_iterator(s+10), 10), ""); + static_assert( constexpr_test(random_access_iterator(s), random_access_iterator(s+10), 10), ""); + static_assert( constexpr_test(s, s+10, 10), ""); + } +#endif } Modified: vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp Wed May 17 20:23:03 2017 (r318419) +++ vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp Wed May 17 20:23:06 2017 (r318420) @@ -33,8 +33,25 @@ test(It i, It x) assert(std::next(i) == x); } +#if TEST_STD_VER > 14 +template +constexpr bool +constexpr_test(It i, typename std::iterator_traits::difference_type n, It x) +{ + return std::next(i, n) == x; +} + +template +constexpr bool +constexpr_test(It i, It x) +{ + return std::next(i) == x; +} +#endif + int main() { + { const char* s = "1234567890"; test(input_iterator(s), 10, input_iterator(s+10)); test(forward_iterator(s), 10, forward_iterator(s+10)); @@ -47,4 +64,21 @@ int main() test(bidirectional_iterator(s), bidirectional_iterator(s+1)); test(random_access_iterator(s), random_access_iterator(s+1)); test(s, s+1); + } +#if TEST_STD_VER > 14 + { + constexpr const char* s = "1234567890"; + static_assert( constexpr_test(input_iterator(s), 10, input_iterator(s+10)), "" ); + static_assert( constexpr_test(forward_iterator(s), 10, forward_iterator(s+10)), "" ); + static_assert( constexpr_test(bidirectional_iterator(s), 10, bidirectional_iterator(s+10)), "" ); + static_assert( constexpr_test(random_access_iterator(s), 10, random_access_iterator(s+10)), "" ); + static_assert( constexpr_test(s, 10, s+10), "" ); + + static_assert( constexpr_test(input_iterator(s), input_iterator(s+1)), "" ); + static_assert( constexpr_test(forward_iterator(s), forward_iterator(s+1)), "" ); + static_assert( constexpr_test(bidirectional_iterator(s), bidirectional_iterator(s+1)), "" ); + static_assert( constexpr_test(random_access_iterator(s), random_access_iterator(s+1)), "" ); + static_assert( constexpr_test(s, s+1), "" ); + } +#endif } Modified: vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp Wed May 17 20:23:03 2017 (r318419) +++ vendor/libc++/dist/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp Wed May 17 20:23:06 2017 (r318420) @@ -31,8 +31,25 @@ test(It i, It x) assert(std::prev(i) == x); } +#if TEST_STD_VER > 14 +template +constexpr bool +constexpr_test(It i, typename std::iterator_traits::difference_type n, It x) +{ + return std::prev(i, n) == x; +} + +template +constexpr bool +constexpr_test(It i, It x) +{ + return std::prev(i) == x; +} +#endif + int main() { + { const char* s = "1234567890"; test(bidirectional_iterator(s+10), 10, bidirectional_iterator(s)); test(random_access_iterator(s+10), 10, random_access_iterator(s)); @@ -41,4 +58,18 @@ int main() test(bidirectional_iterator(s+1), bidirectional_iterator(s)); test(random_access_iterator(s+1), random_access_iterator(s)); test(s+1, s); + } +#if TEST_STD_VER > 14 + { + constexpr const char* s = "1234567890"; + static_assert( constexpr_test(bidirectional_iterator(s+10), 10, bidirectional_iterator(s)), "" ); + static_assert( constexpr_test(random_access_iterator(s+10), 10, random_access_iterator(s)), "" ); + static_assert( constexpr_test(s+10, 10, s), "" ); + + static_assert( constexpr_test(bidirectional_iterator(s+1), bidirectional_iterator(s)), "" ); + static_assert( constexpr_test(random_access_iterator(s+1), random_access_iterator(s)), "" ); + static_assert( constexpr_test(s+1, s), "" ); + } +#endif + } Modified: vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp Wed May 17 20:23:03 2017 (r318419) +++ vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp Wed May 17 20:23:06 2017 (r318420) @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // -// optional(const optional& rhs); +// constexpr optional(const optional& rhs); #include #include @@ -152,4 +152,9 @@ int main() { test_reference_extension(); } + { + constexpr std::optional o1{4}; + constexpr std::optional o2 = o1; + static_assert( *o2 == 4, "" ); + } } Modified: vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp Wed May 17 20:23:03 2017 (r318419) +++ vendor/libc++/dist/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp Wed May 17 20:23:06 2017 (r318420) @@ -18,7 +18,7 @@ // -// optional(optional&& rhs); +// constexpr optional(optional&& rhs); #include #include @@ -206,4 +206,9 @@ int main() { test_reference_extension(); } + { + constexpr std::optional o1{4}; + constexpr std::optional o2 = std::move(o1); + static_assert( *o2 == 4, "" ); + } } Modified: vendor/libc++/dist/test/support/test_iterators.h ============================================================================== --- vendor/libc++/dist/test/support/test_iterators.h Wed May 17 20:23:03 2017 (r318419) +++ vendor/libc++/dist/test/support/test_iterators.h Wed May 17 20:23:06 2017 (r318420) @@ -68,23 +68,23 @@ public: 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 - input_iterator(const input_iterator& u) :it_(u.it_) {} + TEST_CONSTEXPR_CXX14 input_iterator(const input_iterator& 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 @@ -120,23 +120,23 @@ public: typedef It pointer; typedef typename std::iterator_traits::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 - forward_iterator(const forward_iterator& u) :it_(u.it_) {} + TEST_CONSTEXPR_CXX14 forward_iterator(const forward_iterator& 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 @@ -145,7 +145,7 @@ public: template inline -bool +bool TEST_CONSTEXPR_CXX14 operator==(const forward_iterator& x, const forward_iterator& y) { return x.base() == y.base(); @@ -153,7 +153,7 @@ operator==(const forward_iterator& x, template inline -bool +bool TEST_CONSTEXPR_CXX14 operator!=(const forward_iterator& x, const forward_iterator& y) { return !(x == y); @@ -172,22 +172,22 @@ public: typedef It pointer; typedef typename std::iterator_traits::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 - bidirectional_iterator(const bidirectional_iterator& u) :it_(u.it_) {} + TEST_CONSTEXPR_CXX14 bidirectional_iterator(const bidirectional_iterator& 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 @@ -196,7 +196,7 @@ public: template inline -bool +bool TEST_CONSTEXPR_CXX14 operator==(const bidirectional_iterator& x, const bidirectional_iterator& y) { return x.base() == y.base(); @@ -204,7 +204,7 @@ operator==(const bidirectional_iterator< template inline -bool +bool TEST_CONSTEXPR_CXX14 operator!=(const bidirectional_iterator& x, const bidirectional_iterator& y) { return !(x == y); @@ -223,34 +223,34 @@ public: typedef It pointer; typedef typename std::iterator_traits::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 - random_access_iterator(const random_access_iterator& u) :it_(u.it_) {} + TEST_CONSTEXPR_CXX14 random_access_iterator() : it_() {} + explicit TEST_CONSTEXPR_CXX14 random_access_iterator(It it) : it_(it) {} + template + TEST_CONSTEXPR_CXX14 random_access_iterator(const random_access_iterator& 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 void operator,(T const &) DELETE_FUNCTION; @@ -258,7 +258,7 @@ public: template inline -bool +bool TEST_CONSTEXPR_CXX14 operator==(const random_access_iterator& x, const random_access_iterator& y) { return x.base() == y.base(); @@ -266,7 +266,7 @@ operator==(const random_access_iterator< template inline -bool +bool TEST_CONSTEXPR_CXX14 operator!=(const random_access_iterator& x, const random_access_iterator& y) { return !(x == y); @@ -274,7 +274,7 @@ operator!=(const random_access_iterator< template inline -bool +bool TEST_CONSTEXPR_CXX14 operator<(const random_access_iterator& x, const random_access_iterator& y) { return x.base() < y.base(); @@ -282,7 +282,7 @@ operator<(const random_access_iterator inline -bool +bool TEST_CONSTEXPR_CXX14 operator<=(const random_access_iterator& x, const random_access_iterator& y) { return !(y < x); @@ -290,7 +290,7 @@ operator<=(const random_access_iterator< template inline -bool +bool TEST_CONSTEXPR_CXX14 operator>(const random_access_iterator& x, const random_access_iterator& y) { return y < x; @@ -298,14 +298,14 @@ operator>(const random_access_iterator inline -bool +bool TEST_CONSTEXPR_CXX14 operator>=(const random_access_iterator& x, const random_access_iterator& y) { return !(x < y); } template -inline +inline TEST_CONSTEXPR_CXX14 typename std::iterator_traits::difference_type operator-(const random_access_iterator& x, const random_access_iterator& y) { @@ -313,22 +313,22 @@ operator-(const random_access_iterator -inline Iter base(output_iterator i) { return i.base(); } +inline TEST_CONSTEXPR_CXX14 Iter base(output_iterator i) { return i.base(); } template -inline Iter base(input_iterator i) { return i.base(); } +inline TEST_CONSTEXPR_CXX14 Iter base(input_iterator i) { return i.base(); } template -inline Iter base(forward_iterator i) { return i.base(); } +inline TEST_CONSTEXPR_CXX14 Iter base(forward_iterator i) { return i.base(); } template -inline Iter base(bidirectional_iterator i) { return i.base(); } +inline TEST_CONSTEXPR_CXX14 Iter base(bidirectional_iterator i) { return i.base(); } template -inline Iter base(random_access_iterator i) { return i.base(); } +inline TEST_CONSTEXPR_CXX14 Iter base(random_access_iterator i) { return i.base(); } template // everything else -inline Iter base(Iter i) { return i; } +inline TEST_CONSTEXPR_CXX14 Iter base(Iter i) { return i; } template struct ThrowingIterator {