зеркало из https://github.com/microsoft/STL.git
46 строки
1.3 KiB
C++
46 строки
1.3 KiB
C++
// ranges standard header
|
|
|
|
// Copyright (c) Microsoft Corporation.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#pragma once
|
|
#ifndef _RANGES_
|
|
#define _RANGES_
|
|
#include <yvals_core.h>
|
|
#if _STL_COMPILER_PREPROCESSOR
|
|
#ifndef __cpp_lib_concepts
|
|
#pragma message("The contents of <ranges> are available only with C++20 concepts support.")
|
|
#else // ^^^ !defined(__cpp_lib_concepts) / defined(__cpp_lib_concepts) vvv
|
|
#include <iterator>
|
|
|
|
#pragma pack(push, _CRT_PACKING)
|
|
#pragma warning(push, _STL_WARNING_LEVEL)
|
|
#pragma warning(disable : _STL_DISABLED_WARNINGS)
|
|
_STL_DISABLE_CLANG_WARNINGS
|
|
#pragma push_macro("new")
|
|
#undef new
|
|
|
|
_STD_BEGIN
|
|
namespace ranges {
|
|
// Much machinery defined in <xutility>
|
|
|
|
// clang-format off
|
|
// CONCEPT ranges::common_range
|
|
template <class _Rng>
|
|
concept common_range = range<_Rng> && same_as<iterator_t<_Rng>, sentinel_t<_Rng>>;
|
|
|
|
// CONCEPT ranges::viewable_range
|
|
template <class _Rng>
|
|
concept viewable_range = range<_Rng> && (safe_range<_Rng> || view<remove_cvref_t<_Rng>>);
|
|
// clang-format on
|
|
} // namespace ranges
|
|
_STD_END
|
|
|
|
#pragma pop_macro("new")
|
|
_STL_RESTORE_CLANG_WARNINGS
|
|
#pragma warning(pop)
|
|
#pragma pack(pop)
|
|
#endif // __cpp_lib_concepts
|
|
#endif // _STL_COMPILER_PREPROCESSOR
|
|
#endif // _RANGES_
|