Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/std/ranges/range.view/view_base.compile.pass.cpp
- This file was copied from libcxx/test/std/containers/associative/set/range_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 | |||||
// set | // <ranges> | ||||
#include <set> | // struct view_base { }; | ||||
#include <concepts> | |||||
#include <ranges> | #include <ranges> | ||||
#include <type_traits> | |||||
using range = std::set<int>; | static_assert(std::is_empty_v<std::ranges::view_base>); | ||||
namespace stdr = std::ranges; | static_assert(std::is_trivial_v<std::ranges::view_base>); | ||||
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>); | // Make sure we can inherit from it, as it's intended (that wouldn't be the | ||||
static_assert(stdr::common_range<range>); | // case if e.g. it was marked as final). | ||||
static_assert(stdr::input_range<range>); | struct View : std::ranges::view_base { }; | ||||
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>); | |||||
static_assert(stdr::common_range<range const>); | |||||
static_assert(stdr::input_range<range>); |