diff options
Diffstat (limited to 'libcxx/include/iterator')
-rw-r--r-- | libcxx/include/iterator | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/libcxx/include/iterator b/libcxx/include/iterator index ba9a83b9e5e..797ec5332e3 100644 --- a/libcxx/include/iterator +++ b/libcxx/include/iterator @@ -378,25 +378,25 @@ public: bool failed() const noexcept; }; -template <class C> auto begin(C& c) -> decltype(c.begin()); -template <class C> auto begin(const C& c) -> decltype(c.begin()); -template <class C> auto end(C& c) -> decltype(c.end()); -template <class C> auto end(const C& c) -> decltype(c.end()); -template <class T, size_t N> T* begin(T (&array)[N]); -template <class T, size_t N> T* end(T (&array)[N]); - -template <class C> auto cbegin(const C& c) -> decltype(std::begin(c)); // C++14 -template <class C> auto cend(const C& c) -> decltype(std::end(c)); // C++14 -template <class C> auto rbegin(C& c) -> decltype(c.rbegin()); // C++14 -template <class C> auto rbegin(const C& c) -> decltype(c.rbegin()); // C++14 -template <class C> auto rend(C& c) -> decltype(c.rend()); // C++14 -template <class C> auto rend(const C& c) -> decltype(c.rend()); // C++14 -template <class E> reverse_iterator<const E*> rbegin(initializer_list<E> il); // C++14 -template <class E> reverse_iterator<const E*> rend(initializer_list<E> il); // C++14 -template <class T, size_t N> reverse_iterator<T*> rbegin(T (&array)[N]); // C++14 -template <class T, size_t N> reverse_iterator<T*> rend(T (&array)[N]); // C++14 -template <class C> auto crbegin(const C& c) -> decltype(std::rbegin(c)); // C++14 -template <class C> auto crend(const C& c) -> decltype(std::rend(c)); // C++14 +template <class C> constexpr auto begin(C& c) -> decltype(c.begin()); +template <class C> constexpr auto begin(const C& c) -> decltype(c.begin()); +template <class C> constexpr auto end(C& c) -> decltype(c.end()); +template <class C> constexpr auto end(const C& c) -> decltype(c.end()); +template <class T, size_t N> constexpr T* begin(T (&array)[N]); +template <class T, size_t N> constexpr T* end(T (&array)[N]); + +template <class C> auto constexpr cbegin(const C& c) -> decltype(std::begin(c)); // C++14 +template <class C> auto constexpr cend(const C& c) -> decltype(std::end(c)); // C++14 +template <class C> auto constexpr rbegin(C& c) -> decltype(c.rbegin()); // C++14 +template <class C> auto constexpr rbegin(const C& c) -> decltype(c.rbegin()); // C++14 +template <class C> auto constexpr rend(C& c) -> decltype(c.rend()); // C++14 +template <class C> constexpr auto rend(const C& c) -> decltype(c.rend()); // C++14 +template <class E> reverse_iterator<const E*> constexpr rbegin(initializer_list<E> il); // C++14 +template <class E> reverse_iterator<const E*> constexpr rend(initializer_list<E> il); // C++14 +template <class T, size_t N> reverse_iterator<T*> constexpr rbegin(T (&array)[N]); // C++14 +template <class T, size_t N> reverse_iterator<T*> constexpr rend(T (&array)[N]); // C++14 +template <class C> constexpr auto crbegin(const C& c) -> decltype(std::rbegin(c)); // C++14 +template <class C> constexpr auto crend(const C& c) -> decltype(std::rend(c)); // C++14 // 24.8, container access: template <class C> constexpr auto size(const C& c) -> decltype(c.size()); // C++17 @@ -1616,7 +1616,7 @@ end(_Tp (&__array)[_Np]) #if !defined(_LIBCPP_CXX03_LANG) template <class _Cp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 auto begin(_Cp& __c) -> decltype(__c.begin()) { @@ -1624,7 +1624,7 @@ begin(_Cp& __c) -> decltype(__c.begin()) } template <class _Cp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 auto begin(const _Cp& __c) -> decltype(__c.begin()) { @@ -1632,7 +1632,7 @@ begin(const _Cp& __c) -> decltype(__c.begin()) } template <class _Cp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 auto end(_Cp& __c) -> decltype(__c.end()) { @@ -1640,7 +1640,7 @@ end(_Cp& __c) -> decltype(__c.end()) } template <class _Cp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 auto end(const _Cp& __c) -> decltype(__c.end()) { @@ -1650,28 +1650,28 @@ end(const _Cp& __c) -> decltype(__c.end()) #if _LIBCPP_STD_VER > 11 template <class _Tp, size_t _Np> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np]) { return reverse_iterator<_Tp*>(__array + _Np); } template <class _Tp, size_t _Np> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reverse_iterator<_Tp*> rend(_Tp (&__array)[_Np]) { return reverse_iterator<_Tp*>(__array); } template <class _Ep> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reverse_iterator<const _Ep*> rbegin(initializer_list<_Ep> __il) { return reverse_iterator<const _Ep*>(__il.end()); } template <class _Ep> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reverse_iterator<const _Ep*> rend(initializer_list<_Ep> __il) { return reverse_iterator<const _Ep*>(__il.begin()); @@ -1692,42 +1692,42 @@ auto cend(const _Cp& __c) -> decltype(_VSTD::end(__c)) } template <class _Cp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 auto rbegin(_Cp& __c) -> decltype(__c.rbegin()) { return __c.rbegin(); } template <class _Cp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 auto rbegin(const _Cp& __c) -> decltype(__c.rbegin()) { return __c.rbegin(); } template <class _Cp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 auto rend(_Cp& __c) -> decltype(__c.rend()) { return __c.rend(); } template <class _Cp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 auto rend(const _Cp& __c) -> decltype(__c.rend()) { return __c.rend(); } template <class _Cp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 auto crbegin(const _Cp& __c) -> decltype(_VSTD::rbegin(__c)) { return _VSTD::rbegin(__c); } template <class _Cp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c)) { return _VSTD::rend(__c); |