xref: /freebsd/contrib/llvm-project/libcxx/include/experimental/propagate_const (revision 1db9f3b21e39176dd5b67cf8ac378633b172463e)
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST
11#define _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST
12
13/*
14    propagate_const synopsis
15
16    namespace std { namespace experimental { inline namespace fundamentals_v2 {
17
18    // [propagate_const]
19    template <class T> class propagate_const;
20
21    // [propagate_const.underlying], underlying pointer access
22    constexpr const _Tp& get_underlying(const propagate_const<T>& pt) noexcept;
23    constexpr T& get_underlying(propagate_const<T>& pt) noexcept;
24
25    // [propagate_const.relational], relational operators
26    template <class T> constexpr bool operator==(const propagate_const<T>& pt, nullptr_t);
27    template <class T> constexpr bool operator==(nullptr_t, const propagate_const<T>& pu);
28    template <class T> constexpr bool operator!=(const propagate_const<T>& pt, nullptr_t);
29    template <class T> constexpr bool operator!=(nullptr_t, const propagate_const<T>& pu);
30    template <class T, class U> constexpr bool operator==(const propagate_const<T>& pt, const propagate_const<_Up>& pu);
31    template <class T, class U> constexpr bool operator!=(const propagate_const<T>& pt, const propagate_const<_Up>& pu);
32    template <class T, class U> constexpr bool operator<(const propagate_const<T>& pt, const propagate_const<_Up>& pu);
33    template <class T, class U> constexpr bool operator>(const propagate_const<T>& pt, const propagate_const<_Up>& pu);
34    template <class T, class U> constexpr bool operator<=(const propagate_const<T>& pt, const propagate_const<_Up>& pu);
35    template <class T, class U> constexpr bool operator>=(const propagate_const<T>& pt, const propagate_const<_Up>& pu);
36    template <class T, class U> constexpr bool operator==(const propagate_const<T>& pt, const _Up& u);
37    template <class T, class U> constexpr bool operator!=(const propagate_const<T>& pt, const _Up& u);
38    template <class T, class U> constexpr bool operator<(const propagate_const<T>& pt, const _Up& u);
39    template <class T, class U> constexpr bool operator>(const propagate_const<T>& pt, const _Up& u);
40    template <class T, class U> constexpr bool operator<=(const propagate_const<T>& pt, const _Up& u);
41    template <class T, class U> constexpr bool operator>=(const propagate_const<T>& pt, const _Up& u);
42    template <class T, class U> constexpr bool operator==(const _Tp& t, const propagate_const<_Up>& pu);
43    template <class T, class U> constexpr bool operator!=(const _Tp& t, const propagate_const<_Up>& pu);
44    template <class T, class U> constexpr bool operator<(const _Tp& t, const propagate_const<_Up>& pu);
45    template <class T, class U> constexpr bool operator>(const _Tp& t, const propagate_const<_Up>& pu);
46    template <class T, class U> constexpr bool operator<=(const _Tp& t, const propagate_const<_Up>& pu);
47    template <class T, class U> constexpr bool operator>=(const _Tp& t, const propagate_const<_Up>& pu);
48
49    // [propagate_const.algorithms], specialized algorithms
50    template <class T> constexpr void swap(propagate_const<T>& pt, propagate_const<T>& pu) noexcept(see below);
51
52    template <class T>
53    class propagate_const
54    {
55
56    public:
57      typedef remove_reference_t<decltype(*declval<T&>())> element_type;
58
59      // [propagate_const.ctor], constructors
60      constexpr propagate_const() = default;
61      propagate_const(const propagate_const& p) = delete;
62      constexpr propagate_const(propagate_const&& p) = default;
63      template <class U> EXPLICIT constexpr propagate_const(propagate_const<_Up>&& pu); // see below
64      template <class U> EXPLICIT constexpr propagate_const(U&& u); // see below
65
66      // [propagate_const.assignment], assignment
67      propagate_const& operator=(const propagate_const& p) = delete;
68      constexpr propagate_const& operator=(propagate_const&& p) = default;
69      template <class U> constexpr propagate_const& operator=(propagate_const<_Up>&& pu);
70      template <class U> constexpr propagate_const& operator=(U&& u); // see below
71
72      // [propagate_const.const_observers], const observers
73      explicit constexpr operator bool() const;
74      constexpr const element_type* operator->() const;
75      constexpr operator const element_type*() const; // Not always defined
76      constexpr const element_type& operator*() const;
77      constexpr const element_type* get() const;
78
79      // [propagate_const.non_const_observers], non-const observers
80      constexpr element_type* operator->();
81      constexpr operator element_type*(); // Not always defined
82      constexpr element_type& operator*();
83      constexpr element_type* get();
84
85      // [propagate_const.modifiers], modifiers
86      constexpr void swap(propagate_const& pt) noexcept(see below)
87
88    private:
89      T t_; // exposition only
90    };
91
92  } // namespace fundamentals_v2
93  } // namespace experimental
94
95  // [propagate_const.hash], hash support
96  template <class T> struct hash<experimental::propagate_const<T>>;
97
98  // [propagate_const.comparison_function_objects], comparison function objects
99  template <class T> struct equal_to<experimental::propagate_const<T>>;
100  template <class T> struct not_equal_to<experimental::propagate_const<T>>;
101  template <class T> struct less<experimental::propagate_const<T>>;
102  template <class T> struct greater<experimental::propagate_const<T>>;
103  template <class T> struct less_equal<experimental::propagate_const<T>>;
104  template <class T> struct greater_equal<experimental::propagate_const<T>>;
105
106} // namespace std
107
108*/
109
110#include <__assert> // all public C++ headers provide the assertion handler
111#include <__functional/operations.h>
112#include <__fwd/hash.h>
113#include <__type_traits/conditional.h>
114#include <__type_traits/decay.h>
115#include <__type_traits/enable_if.h>
116#include <__type_traits/is_array.h>
117#include <__type_traits/is_constructible.h>
118#include <__type_traits/is_convertible.h>
119#include <__type_traits/is_function.h>
120#include <__type_traits/is_pointer.h>
121#include <__type_traits/is_reference.h>
122#include <__type_traits/is_same.h>
123#include <__type_traits/is_swappable.h>
124#include <__type_traits/remove_cv.h>
125#include <__type_traits/remove_pointer.h>
126#include <__type_traits/remove_reference.h>
127#include <__utility/declval.h>
128#include <__utility/forward.h>
129#include <__utility/move.h>
130#include <__utility/swap.h>
131#include <cstddef>
132#include <experimental/__config>
133
134#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
135#  pragma GCC system_header
136#endif
137
138_LIBCPP_PUSH_MACROS
139#include <__undef_macros>
140
141#if _LIBCPP_STD_VER >= 14
142
143_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
144
145template <class _Tp>
146class propagate_const;
147
148template <class _Up>
149inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const _Up& get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
150
151template <class _Up>
152inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Up& get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
153
154template <class _Tp>
155class propagate_const {
156public:
157  typedef remove_reference_t<decltype(*std::declval<_Tp&>())> element_type;
158
159  static_assert(!is_array<_Tp>::value, "Instantiation of propagate_const with an array type is ill-formed.");
160  static_assert(!is_reference<_Tp>::value, "Instantiation of propagate_const with a reference type is ill-formed.");
161  static_assert(!(is_pointer<_Tp>::value && is_function<__remove_pointer_t<_Tp> >::value),
162                "Instantiation of propagate_const with a function-pointer type is ill-formed.");
163  static_assert(!(is_pointer<_Tp>::value && is_same<__remove_cv_t<__remove_pointer_t<_Tp> >, void>::value),
164                "Instantiation of propagate_const with a pointer to (possibly cv-qualified) void is ill-formed.");
165
166private:
167  template <class _Up>
168  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up* __u) {
169    return __u;
170  }
171
172  template <class _Up>
173  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up& __u) {
174    return __get_pointer(__u.get());
175  }
176
177  template <class _Up>
178  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up* __u) {
179    return __u;
180  }
181
182  template <class _Up>
183  static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up& __u) {
184    return __get_pointer(__u.get());
185  }
186
187  template <class _Up>
188  struct __is_propagate_const : false_type {};
189
190  template <class _Up>
191  struct __is_propagate_const<propagate_const<_Up>> : true_type {};
192
193  _Tp __t_;
194
195public:
196  template <class _Up>
197  friend _LIBCPP_CONSTEXPR const _Up&
198  experimental::fundamentals_v2::get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
199  template <class _Up>
200  friend _LIBCPP_CONSTEXPR _Up& experimental::fundamentals_v2::get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
201
202  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const() = default;
203
204  propagate_const(const propagate_const&) = delete;
205
206  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(propagate_const&&) = default;
207
208  template <class _Up,
209            enable_if_t<!is_convertible<_Up, _Tp>::value && is_constructible<_Tp, _Up&&>::value, bool> = true>
210  explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu)
211      : __t_(std::move(experimental::get_underlying(__pu))) {}
212
213  template <class _Up,
214            enable_if_t<is_convertible<_Up&&, _Tp>::value && is_constructible<_Tp, _Up&&>::value, bool> = false>
215  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu)
216      : __t_(std::move(experimental::get_underlying(__pu))) {}
217
218  template <class _Up,
219            enable_if_t<!is_convertible<_Up&&, _Tp>::value && is_constructible<_Tp, _Up&&>::value &&
220                            !__is_propagate_const<decay_t<_Up>>::value,
221                        bool> = true>
222  explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(_Up&& __u) : __t_(std::forward<_Up>(__u)) {}
223
224  template <class _Up,
225            enable_if_t<is_convertible<_Up&&, _Tp>::value && is_constructible<_Tp, _Up&&>::value &&
226                            !__is_propagate_const<decay_t<_Up>>::value,
227                        bool> = false>
228  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(_Up&& __u) : __t_(std::forward<_Up>(__u)) {}
229
230  propagate_const& operator=(const propagate_const&) = delete;
231
232  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const&&) = default;
233
234  template <class _Up>
235  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const<_Up>&& __pu) {
236    __t_ = std::move(experimental::get_underlying(__pu));
237    return *this;
238  }
239
240  template <class _Up, class _Vp = enable_if_t<!__is_propagate_const<decay_t<_Up>>::value>>
241  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const& operator=(_Up&& __u) {
242    __t_ = std::forward<_Up>(__u);
243    return *this;
244  }
245
246  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* get() const { return __get_pointer(__t_); }
247
248  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* get() { return __get_pointer(__t_); }
249
250  _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR operator bool() const { return get() != nullptr; }
251
252  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* operator->() const { return get(); }
253
254  template <class _Dummy = _Tp, class _Up = enable_if_t<is_convertible< const _Dummy, const element_type*>::value>>
255  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR operator const element_type*() const {
256    return get();
257  }
258
259  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type& operator*() const { return *get(); }
260
261  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* operator->() { return get(); }
262
263  template <class _Dummy = _Tp, class _Up = enable_if_t< is_convertible<_Dummy, element_type*>::value>>
264  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR operator element_type*() {
265    return get();
266  }
267
268  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type& operator*() { return *get(); }
269
270  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR void swap(propagate_const& __pt)
271      _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
272    using std::swap;
273    swap(__t_, __pt.__t_);
274  }
275};
276
277template <class _Tp>
278_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, nullptr_t) {
279  return experimental::get_underlying(__pt) == nullptr;
280}
281
282template <class _Tp>
283_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator==(nullptr_t, const propagate_const<_Tp>& __pt) {
284  return nullptr == experimental::get_underlying(__pt);
285}
286
287template <class _Tp>
288_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, nullptr_t) {
289  return experimental::get_underlying(__pt) != nullptr;
290}
291
292template <class _Tp>
293_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, const propagate_const<_Tp>& __pt) {
294  return nullptr != experimental::get_underlying(__pt);
295}
296
297template <class _Tp, class _Up>
298_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
299operator==(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) {
300  return experimental::get_underlying(__pt) == experimental::get_underlying(__pu);
301}
302
303template <class _Tp, class _Up>
304_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
305operator!=(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) {
306  return experimental::get_underlying(__pt) != experimental::get_underlying(__pu);
307}
308
309template <class _Tp, class _Up>
310_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
311operator<(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) {
312  return experimental::get_underlying(__pt) < experimental::get_underlying(__pu);
313}
314
315template <class _Tp, class _Up>
316_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
317operator>(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) {
318  return experimental::get_underlying(__pt) > experimental::get_underlying(__pu);
319}
320
321template <class _Tp, class _Up>
322_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
323operator<=(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) {
324  return experimental::get_underlying(__pt) <= experimental::get_underlying(__pu);
325}
326
327template <class _Tp, class _Up>
328_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
329operator>=(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) {
330  return experimental::get_underlying(__pt) >= experimental::get_underlying(__pu);
331}
332
333template <class _Tp, class _Up>
334_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, const _Up& __u) {
335  return experimental::get_underlying(__pt) == __u;
336}
337
338template <class _Tp, class _Up>
339_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, const _Up& __u) {
340  return experimental::get_underlying(__pt) != __u;
341}
342
343template <class _Tp, class _Up>
344_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator<(const propagate_const<_Tp>& __pt, const _Up& __u) {
345  return experimental::get_underlying(__pt) < __u;
346}
347
348template <class _Tp, class _Up>
349_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator>(const propagate_const<_Tp>& __pt, const _Up& __u) {
350  return experimental::get_underlying(__pt) > __u;
351}
352
353template <class _Tp, class _Up>
354_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator<=(const propagate_const<_Tp>& __pt, const _Up& __u) {
355  return experimental::get_underlying(__pt) <= __u;
356}
357
358template <class _Tp, class _Up>
359_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator>=(const propagate_const<_Tp>& __pt, const _Up& __u) {
360  return experimental::get_underlying(__pt) >= __u;
361}
362
363template <class _Tp, class _Up>
364_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator==(const _Tp& __t, const propagate_const<_Up>& __pu) {
365  return __t == experimental::get_underlying(__pu);
366}
367
368template <class _Tp, class _Up>
369_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator!=(const _Tp& __t, const propagate_const<_Up>& __pu) {
370  return __t != experimental::get_underlying(__pu);
371}
372
373template <class _Tp, class _Up>
374_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator<(const _Tp& __t, const propagate_const<_Up>& __pu) {
375  return __t < experimental::get_underlying(__pu);
376}
377
378template <class _Tp, class _Up>
379_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator>(const _Tp& __t, const propagate_const<_Up>& __pu) {
380  return __t > experimental::get_underlying(__pu);
381}
382
383template <class _Tp, class _Up>
384_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator<=(const _Tp& __t, const propagate_const<_Up>& __pu) {
385  return __t <= experimental::get_underlying(__pu);
386}
387
388template <class _Tp, class _Up>
389_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool operator>=(const _Tp& __t, const propagate_const<_Up>& __pu) {
390  return __t >= experimental::get_underlying(__pu);
391}
392
393template <class _Tp>
394_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR void swap(propagate_const<_Tp>& __pc1, propagate_const<_Tp>& __pc2)
395    _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
396  __pc1.swap(__pc2);
397}
398
399template <class _Tp>
400_LIBCPP_CONSTEXPR const _Tp& get_underlying(const propagate_const<_Tp>& __pt) _NOEXCEPT {
401  return __pt.__t_;
402}
403
404template <class _Tp>
405_LIBCPP_CONSTEXPR _Tp& get_underlying(propagate_const<_Tp>& __pt) _NOEXCEPT {
406  return __pt.__t_;
407}
408
409_LIBCPP_END_NAMESPACE_LFTS_V2
410
411_LIBCPP_BEGIN_NAMESPACE_STD
412
413template <class _Tp>
414struct hash<experimental::propagate_const<_Tp>> {
415  typedef size_t result_type;
416  typedef experimental::propagate_const<_Tp> argument_type;
417
418  _LIBCPP_HIDE_FROM_ABI size_t operator()(const experimental::propagate_const<_Tp>& __pc1) const {
419    return std::hash<_Tp>()(experimental::get_underlying(__pc1));
420  }
421};
422
423template <class _Tp>
424struct equal_to<experimental::propagate_const<_Tp>> {
425  typedef experimental::propagate_const<_Tp> first_argument_type;
426  typedef experimental::propagate_const<_Tp> second_argument_type;
427
428  _LIBCPP_HIDE_FROM_ABI bool
429  operator()(const experimental::propagate_const<_Tp>& __pc1, const experimental::propagate_const<_Tp>& __pc2) const {
430    return std::equal_to<_Tp>()(experimental::get_underlying(__pc1), experimental::get_underlying(__pc2));
431  }
432};
433
434template <class _Tp>
435struct not_equal_to<experimental::propagate_const<_Tp>> {
436  typedef experimental::propagate_const<_Tp> first_argument_type;
437  typedef experimental::propagate_const<_Tp> second_argument_type;
438
439  _LIBCPP_HIDE_FROM_ABI bool
440  operator()(const experimental::propagate_const<_Tp>& __pc1, const experimental::propagate_const<_Tp>& __pc2) const {
441    return std::not_equal_to<_Tp>()(experimental::get_underlying(__pc1), experimental::get_underlying(__pc2));
442  }
443};
444
445template <class _Tp>
446struct less<experimental::propagate_const<_Tp>> {
447  typedef experimental::propagate_const<_Tp> first_argument_type;
448  typedef experimental::propagate_const<_Tp> second_argument_type;
449
450  _LIBCPP_HIDE_FROM_ABI bool
451  operator()(const experimental::propagate_const<_Tp>& __pc1, const experimental::propagate_const<_Tp>& __pc2) const {
452    return std::less<_Tp>()(experimental::get_underlying(__pc1), experimental::get_underlying(__pc2));
453  }
454};
455
456template <class _Tp>
457struct greater<experimental::propagate_const<_Tp>> {
458  typedef experimental::propagate_const<_Tp> first_argument_type;
459  typedef experimental::propagate_const<_Tp> second_argument_type;
460
461  _LIBCPP_HIDE_FROM_ABI bool
462  operator()(const experimental::propagate_const<_Tp>& __pc1, const experimental::propagate_const<_Tp>& __pc2) const {
463    return std::greater<_Tp>()(experimental::get_underlying(__pc1), experimental::get_underlying(__pc2));
464  }
465};
466
467template <class _Tp>
468struct less_equal<experimental::propagate_const<_Tp>> {
469  typedef experimental::propagate_const<_Tp> first_argument_type;
470  typedef experimental::propagate_const<_Tp> second_argument_type;
471
472  _LIBCPP_HIDE_FROM_ABI bool
473  operator()(const experimental::propagate_const<_Tp>& __pc1, const experimental::propagate_const<_Tp>& __pc2) const {
474    return std::less_equal<_Tp>()(experimental::get_underlying(__pc1), experimental::get_underlying(__pc2));
475  }
476};
477
478template <class _Tp>
479struct greater_equal<experimental::propagate_const<_Tp>> {
480  typedef experimental::propagate_const<_Tp> first_argument_type;
481  typedef experimental::propagate_const<_Tp> second_argument_type;
482
483  _LIBCPP_HIDE_FROM_ABI bool
484  operator()(const experimental::propagate_const<_Tp>& __pc1, const experimental::propagate_const<_Tp>& __pc2) const {
485    return std::greater_equal<_Tp>()(experimental::get_underlying(__pc1), experimental::get_underlying(__pc2));
486  }
487};
488
489_LIBCPP_END_NAMESPACE_STD
490
491#endif // _LIBCPP_STD_VER >= 14
492
493_LIBCPP_POP_MACROS
494
495#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
496#  include <type_traits>
497#endif
498
499#endif // _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST
500