Lines Matching +full:- +full:c

1 //===----------------------------------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03
13 // template <class C> constexpr auto begin(C& c) -> decltype(c.begin()); // const…
14 // template <class C> constexpr auto begin(const C& c) -> decltype(c.begin()); // const…
15 // template <class C> constexpr auto end(C& c) -> decltype(c.end()); // const…
16 // template <class C> constexpr auto end(const C& c) -> decltype(c.end()); // const…
18 // template <class C> constexpr auto cbegin(const C& c) noexcept(see-below) -> decltype(std::begin(
19 // template <class C> constexpr auto cend(const C& c) noexcept(see-below) -> decltype(std::end(c));…
20 // template <class C> constexpr auto rbegin(C& c) -> decltype(c.rbegin()); // C++14…
21 // template <class C> constexpr auto rbegin(const C& c) -> decltype(c.rbegin()); // C++14…
22 // template <class C> constexpr auto rend(C& c) -> decltype(c.rend()); // C++14…
23 // template <class C> constexpr auto rend(const C& c) -> decltype(c.rend()); // C++14…
24 // template <class C> constexpr auto crbegin(const C& c) -> decltype(std::rbegin(c)); // C++14…
25 // template <class C> constexpr auto crend(const C& c) -> decltype(std::rend(c)); // C++14…
35 template <typename C,
36 typename Iterator = typename C::iterator,
37 typename ConstIterator = typename C::const_iterator,
38 typename ReverseIterator = typename C::reverse_iterator,
39 typename ConstReverseIterator = typename C::const_reverse_iterator>
41 C c = {1, 2, 3}; in test() local
42 const C& cc = c; in test()
44 // std::begin(C& c) / std::end(C& c) in test()
46 ASSERT_SAME_TYPE(decltype(std::begin(c)), Iterator); in test()
47 assert(std::begin(c) == c.begin()); in test()
49 ASSERT_SAME_TYPE(decltype(std::end(c)), Iterator); in test()
50 assert(std::end(c) == c.end()); in test()
53 // std::begin(C const& c) / std::end(C const& c) in test()
63 // std::cbegin(C const&) / std::cend(C const&) in test()
74 ASSERT_SAME_TYPE(decltype(std::cbegin(c)), ConstIterator); in test()
75 static_assert(noexcept(std::cbegin(c)) == noexcept(std::begin(cc)), ""); in test()
76 assert(std::cbegin(c) == std::begin(cc)); in test()
78 ASSERT_SAME_TYPE(decltype(std::cend(c)), ConstIterator); in test()
79 static_assert(noexcept(std::cend(c)) == noexcept(std::end(cc)), ""); in test()
80 assert(std::cend(c) == std::end(cc)); in test()
83 // std::rbegin(C& c) / std::rend(C& c) in test()
85 ASSERT_SAME_TYPE(decltype(std::rbegin(c)), ReverseIterator); in test()
86 assert(std::rbegin(c) == c.rbegin()); in test()
88 ASSERT_SAME_TYPE(decltype(std::rend(c)), ReverseIterator); in test()
89 assert(std::rend(c) == c.rend()); in test()
92 // std::rbegin(C const&) / std::rend(C const&) in test()
101 // std::crbegin(C const&) / std::crend(C const&) in test()
110 ASSERT_SAME_TYPE(decltype(std::crbegin(c)), ConstReverseIterator); in test()
111 assert(std::crbegin(c) == std::rbegin(cc)); in test()
113 ASSERT_SAME_TYPE(decltype(std::crend(c)), ConstReverseIterator); in test()
114 assert(std::crend(c) == std::rend(cc)); in test()
130 // Note: Properly testing the conditional noexcept-ness propagation in std::cbegin and std::cend in main()
131 // requires using C-style arrays, because those are the only ones with a noexcept std::begin in main()
145 // Make sure std::cbegin and std::cend are constexpr in C++14 too (see LWG2280). in main()