Differential D100278 Diff 342544 libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.bidir/subsumption.compile.pass.cpp
Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.bidir/subsumption.compile.pass.cpp
- This file was copied from libcxx/test/std/re/re.iter/re.regiter/iterator_concept_conformance.compile.pass.cpp.
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// UNSUPPORTED: c++03, c++11, c++14, c++17 | // UNSUPPORTED: c++03, c++11, c++14, c++17 | ||||
// UNSUPPORTED: libcpp-no-concepts | // UNSUPPORTED: libcpp-no-concepts | ||||
// UNSUPPORTED: gcc-10 | // UNSUPPORTED: gcc-10 | ||||
// regex_iterator | // template<class T> | ||||
// concept bidirectional_iterator; | |||||
#include <regex> | |||||
#include <iterator> | #include <iterator> | ||||
static_assert(std::forward_iterator<std::cregex_iterator>); | #include <concepts> | ||||
static_assert(!std::indirectly_writable<std::cregex_iterator, char>); | |||||
static_assert(std::sentinel_for<std::cregex_iterator, std::cregex_iterator>); | template<std::forward_iterator I> | ||||
static_assert(!std::sized_sentinel_for<std::cregex_iterator, std::cregex_iterator>); | [[nodiscard]] constexpr bool check_subsumption() { | ||||
return false; | |||||
} | |||||
template<std::bidirectional_iterator> | |||||
[[nodiscard]] constexpr bool check_subsumption() { | |||||
return true; | |||||
} | |||||
static_assert(check_subsumption<int*>()); |