Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:56

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP___MEMORY_CONCEPTS_H
0011 #define _LIBCPP___MEMORY_CONCEPTS_H
0012 
0013 #include <__concepts/same_as.h>
0014 #include <__config>
0015 #include <__iterator/concepts.h>
0016 #include <__iterator/iterator_traits.h>
0017 #include <__iterator/readable_traits.h>
0018 #include <__ranges/access.h>
0019 #include <__ranges/concepts.h>
0020 #include <__type_traits/is_reference.h>
0021 #include <__type_traits/remove_cvref.h>
0022 #include <__type_traits/remove_reference.h> // TODO(modules): This should not be required
0023 
0024 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0025 #  pragma GCC system_header
0026 #endif
0027 
0028 _LIBCPP_BEGIN_NAMESPACE_STD
0029 
0030 #if _LIBCPP_STD_VER >= 20
0031 
0032 namespace ranges {
0033 
0034 // [special.mem.concepts]
0035 
0036 // This concept ensures that uninitialized algorithms can construct an object
0037 // at the address pointed-to by the iterator, which requires an lvalue.
0038 template <class _Ip>
0039 concept __nothrow_input_iterator =
0040     input_iterator<_Ip> && is_lvalue_reference_v<iter_reference_t<_Ip>> &&
0041     same_as<remove_cvref_t<iter_reference_t<_Ip>>, iter_value_t<_Ip>>;
0042 
0043 template <class _Sp, class _Ip>
0044 concept __nothrow_sentinel_for = sentinel_for<_Sp, _Ip>;
0045 
0046 template <class _Rp>
0047 concept __nothrow_input_range =
0048     range<_Rp> && __nothrow_input_iterator<iterator_t<_Rp>> && __nothrow_sentinel_for<sentinel_t<_Rp>, iterator_t<_Rp>>;
0049 
0050 template <class _Ip>
0051 concept __nothrow_forward_iterator =
0052     __nothrow_input_iterator<_Ip> && forward_iterator<_Ip> && __nothrow_sentinel_for<_Ip, _Ip>;
0053 
0054 template <class _Rp>
0055 concept __nothrow_forward_range = __nothrow_input_range<_Rp> && __nothrow_forward_iterator<iterator_t<_Rp>>;
0056 
0057 } // namespace ranges
0058 
0059 #endif // _LIBCPP_STD_VER >= 20
0060 
0061 _LIBCPP_END_NAMESPACE_STD
0062 
0063 #endif // _LIBCPP___MEMORY_CONCEPTS_H