//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: no-localization // UNSUPPORTED: c++03, c++11, c++14, c++17 // concept checking istream_view #include #include #include "test_macros.h" template > concept HasIstreamView = requires { typename std::ranges::basic_istream_view; }; static_assert(HasIstreamView); #ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(HasIstreamView); #endif // Unmovable Val struct Unmovable { Unmovable() = default; Unmovable(Unmovable&&) = delete; template friend std::basic_istream& operator>>(std::basic_istream& x, const Unmovable&) { return x; } }; static_assert(!HasIstreamView); #ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(!HasIstreamView); #endif // !default_initializable struct NoDefaultCtor { NoDefaultCtor(int) {} friend std::istream& operator>>(std::istream& x, const NoDefaultCtor&) { return x; } }; static_assert(!HasIstreamView); #ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(!HasIstreamView); #endif // !stream-extractable struct Foo {}; static_assert(!HasIstreamView); #ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(!HasIstreamView); #endif template concept OnlyInputRange = std::ranges::input_range && !std::ranges::forward_range; static_assert(OnlyInputRange>); static_assert(OnlyInputRange>); static_assert(OnlyInputRange>); static_assert(OnlyInputRange>); #ifndef TEST_HAS_NO_WIDE_CHARACTERS static_assert(OnlyInputRange>); static_assert(OnlyInputRange>); static_assert(OnlyInputRange>); static_assert(OnlyInputRange>); #endif