Path: blob/main/contrib/llvm-project/libcxx/include/__memory/concepts.h
35233 views
// -*- C++ -*-1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//89#ifndef _LIBCPP___MEMORY_CONCEPTS_H10#define _LIBCPP___MEMORY_CONCEPTS_H1112#include <__concepts/same_as.h>13#include <__config>14#include <__iterator/concepts.h>15#include <__iterator/iterator_traits.h>16#include <__iterator/readable_traits.h>17#include <__ranges/access.h>18#include <__ranges/concepts.h>19#include <__type_traits/is_reference.h>20#include <__type_traits/remove_cvref.h>21#include <__type_traits/remove_reference.h> // TODO(modules): This should not be required2223#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)24# pragma GCC system_header25#endif2627_LIBCPP_BEGIN_NAMESPACE_STD2829#if _LIBCPP_STD_VER >= 203031namespace ranges {3233// [special.mem.concepts]3435// This concept ensures that uninitialized algorithms can construct an object36// at the address pointed-to by the iterator, which requires an lvalue.37template <class _Ip>38concept __nothrow_input_iterator =39input_iterator<_Ip> && is_lvalue_reference_v<iter_reference_t<_Ip>> &&40same_as<remove_cvref_t<iter_reference_t<_Ip>>, iter_value_t<_Ip>>;4142template <class _Sp, class _Ip>43concept __nothrow_sentinel_for = sentinel_for<_Sp, _Ip>;4445template <class _Rp>46concept __nothrow_input_range =47range<_Rp> && __nothrow_input_iterator<iterator_t<_Rp>> && __nothrow_sentinel_for<sentinel_t<_Rp>, iterator_t<_Rp>>;4849template <class _Ip>50concept __nothrow_forward_iterator =51__nothrow_input_iterator<_Ip> && forward_iterator<_Ip> && __nothrow_sentinel_for<_Ip, _Ip>;5253template <class _Rp>54concept __nothrow_forward_range = __nothrow_input_range<_Rp> && __nothrow_forward_iterator<iterator_t<_Rp>>;5556} // namespace ranges5758#endif // _LIBCPP_STD_VER >= 205960_LIBCPP_END_NAMESPACE_STD6162#endif // _LIBCPP___MEMORY_CONCEPTS_H636465