xref: /llvm-project/libcxx/test/std/strings/basic.string/range_concept_conformance.compile.pass.cpp (revision a40bada91aeda276a772acfbcae6e8de26755a11)
15a3309f8SChristopher Di Bella //===----------------------------------------------------------------------===//
25a3309f8SChristopher Di Bella //
35a3309f8SChristopher Di Bella // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
45a3309f8SChristopher Di Bella // See https://llvm.org/LICENSE.txt for license information.
55a3309f8SChristopher Di Bella // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65a3309f8SChristopher Di Bella //
75a3309f8SChristopher Di Bella //===----------------------------------------------------------------------===//
85a3309f8SChristopher Di Bella 
95a3309f8SChristopher Di Bella // UNSUPPORTED: c++03, c++11, c++14, c++17
105a3309f8SChristopher Di Bella 
115a3309f8SChristopher Di Bella // string
125a3309f8SChristopher Di Bella 
135a3309f8SChristopher Di Bella #include <string>
145a3309f8SChristopher Di Bella 
155a3309f8SChristopher Di Bella #include <concepts>
165a3309f8SChristopher Di Bella #include <ranges>
175a3309f8SChristopher Di Bella 
189d7c420aSLouis Dionne static_assert(std::same_as<std::ranges::iterator_t<std::string>, std::string::iterator>);
199d7c420aSLouis Dionne static_assert(std::ranges::common_range<std::string>);
209d7c420aSLouis Dionne static_assert(std::ranges::random_access_range<std::string>);
219d7c420aSLouis Dionne static_assert(std::ranges::contiguous_range<std::string>);
229d7c420aSLouis Dionne static_assert(!std::ranges::view<std::string>);
239d7c420aSLouis Dionne static_assert(std::ranges::sized_range<std::string>);
249d7c420aSLouis Dionne static_assert(!std::ranges::borrowed_range<std::string>);
25*67151d02SArthur O'Dwyer static_assert(std::ranges::viewable_range<std::string>);
269d7c420aSLouis Dionne 
279d7c420aSLouis Dionne static_assert(std::same_as<std::ranges::iterator_t<std::string const>, std::string::const_iterator>);
289d7c420aSLouis Dionne static_assert(std::ranges::common_range<std::string const>);
299d7c420aSLouis Dionne static_assert(std::ranges::random_access_range<std::string const>);
309d7c420aSLouis Dionne static_assert(std::ranges::contiguous_range<std::string const>);
319d7c420aSLouis Dionne static_assert(!std::ranges::view<std::string const>);
329d7c420aSLouis Dionne static_assert(std::ranges::sized_range<std::string const>);
339d7c420aSLouis Dionne static_assert(!std::ranges::borrowed_range<std::string const>);
349d7c420aSLouis Dionne static_assert(!std::ranges::viewable_range<std::string const>);
35