Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===----------------------------------------------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef _LIBCPP___CXX03___CONCEPTS_COMMON_WITH_H
0010 #define _LIBCPP___CXX03___CONCEPTS_COMMON_WITH_H
0011 
0012 #include <__cxx03/__concepts/common_reference_with.h>
0013 #include <__cxx03/__concepts/same_as.h>
0014 #include <__cxx03/__config>
0015 #include <__cxx03/__type_traits/add_lvalue_reference.h>
0016 #include <__cxx03/__type_traits/common_reference.h>
0017 #include <__cxx03/__type_traits/common_type.h>
0018 #include <__cxx03/__utility/declval.h>
0019 
0020 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0021 #  pragma GCC system_header
0022 #endif
0023 
0024 _LIBCPP_BEGIN_NAMESPACE_STD
0025 
0026 #if _LIBCPP_STD_VER >= 20
0027 
0028 // [concept.common]
0029 
0030 // clang-format off
0031 template <class _Tp, class _Up>
0032 concept common_with =
0033     same_as<common_type_t<_Tp, _Up>, common_type_t<_Up, _Tp>> &&
0034     requires {
0035         static_cast<common_type_t<_Tp, _Up>>(std::declval<_Tp>());
0036         static_cast<common_type_t<_Tp, _Up>>(std::declval<_Up>());
0037     } &&
0038     common_reference_with<
0039         add_lvalue_reference_t<const _Tp>,
0040         add_lvalue_reference_t<const _Up>> &&
0041     common_reference_with<
0042         add_lvalue_reference_t<common_type_t<_Tp, _Up>>,
0043         common_reference_t<
0044             add_lvalue_reference_t<const _Tp>,
0045             add_lvalue_reference_t<const _Up>>>;
0046 // clang-format on
0047 
0048 #endif // _LIBCPP_STD_VER >= 20
0049 
0050 _LIBCPP_END_NAMESPACE_STD
0051 
0052 #endif // _LIBCPP___CXX03___CONCEPTS_COMMON_WITH_H