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& _VSTD_LFTS_V2::get_underlying(const propagate_const<T>& pt) noexcept;
23    constexpr T& _VSTD_LFTS_V2::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::fundamentals_v2::propagate_const<T>>;
97
98  // [propagate_const.comparison_function_objects], comparison function objects
99  template <class T> struct equal_to<experimental::fundamentals_v2::propagate_const<T>>;
100  template <class T> struct not_equal_to<experimental::fundamentals_v2::propagate_const<T>>;
101  template <class T> struct less<experimental::fundamentals_v2::propagate_const<T>>;
102  template <class T> struct greater<experimental::fundamentals_v2::propagate_const<T>>;
103  template <class T> struct less_equal<experimental::fundamentals_v2::propagate_const<T>>;
104  template <class T> struct greater_equal<experimental::fundamentals_v2::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 <__utility/forward.h>
113#include <__utility/move.h>
114#include <__utility/swap.h>
115#include <experimental/__config>
116#include <type_traits>
117
118#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
119#  pragma GCC system_header
120#endif
121
122#if _LIBCPP_STD_VER > 11
123
124_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
125
126template <class _Tp>
127class propagate_const;
128
129template <class _Up>
130inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
131const _Up& get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
132
133template <class _Up>
134inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
135_Up& get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
136
137template <class _Tp>
138class propagate_const
139{
140public:
141  typedef remove_reference_t<decltype(*declval<_Tp&>())> element_type;
142
143  static_assert(!is_array<_Tp>::value,
144      "Instantiation of propagate_const with an array type is ill-formed.");
145  static_assert(!is_reference<_Tp>::value,
146      "Instantiation of propagate_const with a reference type is ill-formed.");
147  static_assert(!(is_pointer<_Tp>::value && is_function<typename remove_pointer<_Tp>::type>::value),
148      "Instantiation of propagate_const with a function-pointer type is ill-formed.");
149  static_assert(!(is_pointer<_Tp>::value && is_same<typename remove_cv<typename remove_pointer<_Tp>::type>::type, void>::value),
150      "Instantiation of propagate_const with a pointer to (possibly cv-qualified) void is ill-formed.");
151
152private:
153  template <class _Up>
154  static _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up* __u)
155  {
156    return __u;
157  }
158
159  template <class _Up>
160  static _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up& __u)
161  {
162    return __get_pointer(__u.get());
163  }
164
165  template <class _Up>
166  static _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up* __u)
167  {
168    return __u;
169  }
170
171  template <class _Up>
172  static _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up& __u)
173  {
174    return __get_pointer(__u.get());
175  }
176
177  template <class _Up>
178  struct __is_propagate_const : false_type
179  {
180  };
181
182  template <class _Up>
183  struct __is_propagate_const<propagate_const<_Up>> : true_type
184  {
185  };
186
187  _Tp __t_;
188
189public:
190
191  template <class _Up> friend _LIBCPP_CONSTEXPR const _Up& ::_VSTD_LFTS_V2::get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
192  template <class _Up> friend _LIBCPP_CONSTEXPR _Up& ::_VSTD_LFTS_V2::get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
193
194  _LIBCPP_CONSTEXPR propagate_const() = default;
195
196  propagate_const(const propagate_const&) = delete;
197
198  _LIBCPP_CONSTEXPR propagate_const(propagate_const&&) = default;
199
200  template <class _Up, enable_if_t<!is_convertible<_Up, _Tp>::value &&
201                                 is_constructible<_Tp, _Up&&>::value,bool> = true>
202  explicit _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu)
203      : __t_(std::move(_VSTD_LFTS_V2::get_underlying(__pu)))
204  {
205  }
206
207  template <class _Up, enable_if_t<is_convertible<_Up&&, _Tp>::value &&
208                                 is_constructible<_Tp, _Up&&>::value,bool> = false>
209  _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu)
210      : __t_(std::move(_VSTD_LFTS_V2::get_underlying(__pu)))
211  {
212  }
213
214  template <class _Up, enable_if_t<!is_convertible<_Up&&, _Tp>::value &&
215                                 is_constructible<_Tp, _Up&&>::value &&
216                                 !__is_propagate_const<decay_t<_Up>>::value,bool> = true>
217  explicit _LIBCPP_CONSTEXPR propagate_const(_Up&& __u)
218      : __t_(std::forward<_Up>(__u))
219  {
220  }
221
222  template <class _Up, enable_if_t<is_convertible<_Up&&, _Tp>::value &&
223                                 is_constructible<_Tp, _Up&&>::value &&
224                                 !__is_propagate_const<decay_t<_Up>>::value,bool> = false>
225  _LIBCPP_CONSTEXPR propagate_const(_Up&& __u)
226      : __t_(std::forward<_Up>(__u))
227  {
228  }
229
230  propagate_const& operator=(const propagate_const&) = delete;
231
232  _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const&&) = default;
233
234  template <class _Up>
235  _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const<_Up>&& __pu)
236  {
237    __t_ = std::move(_VSTD_LFTS_V2::get_underlying(__pu));
238    return *this;
239  }
240
241  template <class _Up, class _Vp = enable_if_t<!__is_propagate_const<decay_t<_Up>>::value>>
242  _LIBCPP_CONSTEXPR propagate_const& operator=(_Up&& __u)
243  {
244    __t_ = std::forward<_Up>(__u);
245    return *this;
246  }
247
248  _LIBCPP_CONSTEXPR const element_type* get() const
249  {
250    return __get_pointer(__t_);
251  }
252
253  _LIBCPP_CONSTEXPR element_type* get()
254  {
255    return __get_pointer(__t_);
256  }
257
258  explicit _LIBCPP_CONSTEXPR operator bool() const
259  {
260    return get() != nullptr;
261  }
262
263  _LIBCPP_CONSTEXPR const element_type* operator->() const
264  {
265    return get();
266  }
267
268  template <class _Tp_ = _Tp, class _Up = enable_if_t<is_convertible<
269                                  const _Tp_, const element_type *>::value>>
270  _LIBCPP_CONSTEXPR operator const element_type *() const {
271    return get();
272  }
273
274  _LIBCPP_CONSTEXPR const element_type& operator*() const
275  {
276    return *get();
277  }
278
279  _LIBCPP_CONSTEXPR element_type* operator->()
280  {
281    return get();
282  }
283
284  template <class _Tp_ = _Tp, class _Up = enable_if_t<
285                                  is_convertible<_Tp_, element_type *>::value>>
286  _LIBCPP_CONSTEXPR operator element_type *() {
287    return get();
288  }
289
290  _LIBCPP_CONSTEXPR element_type& operator*()
291  {
292    return *get();
293  }
294
295  _LIBCPP_CONSTEXPR void swap(propagate_const& __pt) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
296  {
297    using _VSTD::swap;
298    swap(__t_, __pt.__t_);
299  }
300};
301
302
303template <class _Tp>
304_LIBCPP_INLINE_VISIBILITY
305_LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, nullptr_t)
306{
307  return _VSTD_LFTS_V2::get_underlying(__pt) == nullptr;
308}
309
310template <class _Tp>
311_LIBCPP_INLINE_VISIBILITY
312_LIBCPP_CONSTEXPR bool operator==(nullptr_t, const propagate_const<_Tp>& __pt)
313{
314  return nullptr == _VSTD_LFTS_V2::get_underlying(__pt);
315}
316
317template <class _Tp>
318_LIBCPP_INLINE_VISIBILITY
319_LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, nullptr_t)
320{
321  return _VSTD_LFTS_V2::get_underlying(__pt) != nullptr;
322}
323
324template <class _Tp>
325_LIBCPP_INLINE_VISIBILITY
326_LIBCPP_CONSTEXPR bool operator!=(nullptr_t, const propagate_const<_Tp>& __pt)
327{
328  return nullptr != _VSTD_LFTS_V2::get_underlying(__pt);
329}
330
331template <class _Tp, class _Up>
332_LIBCPP_INLINE_VISIBILITY
333_LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt,
334                          const propagate_const<_Up>& __pu)
335{
336  return _VSTD_LFTS_V2::get_underlying(__pt) == _VSTD_LFTS_V2::get_underlying(__pu);
337}
338
339template <class _Tp, class _Up>
340_LIBCPP_INLINE_VISIBILITY
341_LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt,
342                          const propagate_const<_Up>& __pu)
343{
344  return _VSTD_LFTS_V2::get_underlying(__pt) != _VSTD_LFTS_V2::get_underlying(__pu);
345}
346
347template <class _Tp, class _Up>
348_LIBCPP_INLINE_VISIBILITY
349_LIBCPP_CONSTEXPR bool operator<(const propagate_const<_Tp>& __pt,
350                         const propagate_const<_Up>& __pu)
351{
352  return _VSTD_LFTS_V2::get_underlying(__pt) < _VSTD_LFTS_V2::get_underlying(__pu);
353}
354
355template <class _Tp, class _Up>
356_LIBCPP_INLINE_VISIBILITY
357_LIBCPP_CONSTEXPR bool operator>(const propagate_const<_Tp>& __pt,
358                         const propagate_const<_Up>& __pu)
359{
360  return _VSTD_LFTS_V2::get_underlying(__pt) > _VSTD_LFTS_V2::get_underlying(__pu);
361}
362
363template <class _Tp, class _Up>
364_LIBCPP_INLINE_VISIBILITY
365_LIBCPP_CONSTEXPR bool operator<=(const propagate_const<_Tp>& __pt,
366                          const propagate_const<_Up>& __pu)
367{
368  return _VSTD_LFTS_V2::get_underlying(__pt) <= _VSTD_LFTS_V2::get_underlying(__pu);
369}
370
371template <class _Tp, class _Up>
372_LIBCPP_INLINE_VISIBILITY
373_LIBCPP_CONSTEXPR bool operator>=(const propagate_const<_Tp>& __pt,
374                          const propagate_const<_Up>& __pu)
375{
376  return _VSTD_LFTS_V2::get_underlying(__pt) >= _VSTD_LFTS_V2::get_underlying(__pu);
377}
378
379template <class _Tp, class _Up>
380_LIBCPP_INLINE_VISIBILITY
381_LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, const _Up& __u)
382{
383  return _VSTD_LFTS_V2::get_underlying(__pt) == __u;
384}
385
386template <class _Tp, class _Up>
387_LIBCPP_INLINE_VISIBILITY
388_LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, const _Up& __u)
389{
390  return _VSTD_LFTS_V2::get_underlying(__pt) != __u;
391}
392
393template <class _Tp, class _Up>
394_LIBCPP_INLINE_VISIBILITY
395_LIBCPP_CONSTEXPR bool operator<(const propagate_const<_Tp>& __pt, const _Up& __u)
396{
397  return _VSTD_LFTS_V2::get_underlying(__pt) < __u;
398}
399
400template <class _Tp, class _Up>
401_LIBCPP_INLINE_VISIBILITY
402_LIBCPP_CONSTEXPR bool operator>(const propagate_const<_Tp>& __pt, const _Up& __u)
403{
404  return _VSTD_LFTS_V2::get_underlying(__pt) > __u;
405}
406
407template <class _Tp, class _Up>
408_LIBCPP_INLINE_VISIBILITY
409_LIBCPP_CONSTEXPR bool operator<=(const propagate_const<_Tp>& __pt, const _Up& __u)
410{
411  return _VSTD_LFTS_V2::get_underlying(__pt) <= __u;
412}
413
414template <class _Tp, class _Up>
415_LIBCPP_INLINE_VISIBILITY
416_LIBCPP_CONSTEXPR bool operator>=(const propagate_const<_Tp>& __pt, const _Up& __u)
417{
418  return _VSTD_LFTS_V2::get_underlying(__pt) >= __u;
419}
420
421
422template <class _Tp, class _Up>
423_LIBCPP_INLINE_VISIBILITY
424_LIBCPP_CONSTEXPR bool operator==(const _Tp& __t, const propagate_const<_Up>& __pu)
425{
426  return __t == _VSTD_LFTS_V2::get_underlying(__pu);
427}
428
429template <class _Tp, class _Up>
430_LIBCPP_INLINE_VISIBILITY
431_LIBCPP_CONSTEXPR bool operator!=(const _Tp& __t, const propagate_const<_Up>& __pu)
432{
433  return __t != _VSTD_LFTS_V2::get_underlying(__pu);
434}
435
436template <class _Tp, class _Up>
437_LIBCPP_INLINE_VISIBILITY
438_LIBCPP_CONSTEXPR bool operator<(const _Tp& __t, const propagate_const<_Up>& __pu)
439{
440  return __t < _VSTD_LFTS_V2::get_underlying(__pu);
441}
442
443template <class _Tp, class _Up>
444_LIBCPP_INLINE_VISIBILITY
445_LIBCPP_CONSTEXPR bool operator>(const _Tp& __t, const propagate_const<_Up>& __pu)
446{
447  return __t > _VSTD_LFTS_V2::get_underlying(__pu);
448}
449
450template <class _Tp, class _Up>
451_LIBCPP_INLINE_VISIBILITY
452_LIBCPP_CONSTEXPR bool operator<=(const _Tp& __t, const propagate_const<_Up>& __pu)
453{
454  return __t <= _VSTD_LFTS_V2::get_underlying(__pu);
455}
456
457template <class _Tp, class _Up>
458_LIBCPP_INLINE_VISIBILITY
459_LIBCPP_CONSTEXPR bool operator>=(const _Tp& __t, const propagate_const<_Up>& __pu)
460{
461  return __t >= _VSTD_LFTS_V2::get_underlying(__pu);
462}
463
464template <class _Tp>
465_LIBCPP_INLINE_VISIBILITY
466_LIBCPP_CONSTEXPR void swap(propagate_const<_Tp>& __pc1, propagate_const<_Tp>& __pc2) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
467{
468  __pc1.swap(__pc2);
469}
470
471template <class _Tp>
472_LIBCPP_CONSTEXPR const _Tp& get_underlying(const propagate_const<_Tp>& __pt) _NOEXCEPT
473{
474  return __pt.__t_;
475}
476
477template <class _Tp>
478_LIBCPP_CONSTEXPR _Tp& get_underlying(propagate_const<_Tp>& __pt) _NOEXCEPT
479{
480  return __pt.__t_;
481}
482
483_LIBCPP_END_NAMESPACE_LFTS_V2
484
485_LIBCPP_BEGIN_NAMESPACE_STD
486
487template <class _Tp>
488struct hash<experimental::fundamentals_v2::propagate_const<_Tp>>
489{
490  typedef size_t result_type;
491  typedef experimental::fundamentals_v2::propagate_const<_Tp> argument_type;
492
493  size_t operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1) const
494  {
495    return std::hash<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1));
496  }
497};
498
499template <class _Tp>
500struct equal_to<experimental::fundamentals_v2::propagate_const<_Tp>>
501{
502  typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type;
503  typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type;
504
505  bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1,
506      const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const
507  {
508    return std::equal_to<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
509  }
510};
511
512template <class _Tp>
513struct not_equal_to<experimental::fundamentals_v2::propagate_const<_Tp>>
514{
515  typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type;
516  typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type;
517
518  bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1,
519      const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const
520  {
521    return std::not_equal_to<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
522  }
523};
524
525template <class _Tp>
526struct less<experimental::fundamentals_v2::propagate_const<_Tp>>
527{
528  typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type;
529  typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type;
530
531  bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1,
532      const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const
533  {
534    return std::less<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
535  }
536};
537
538template <class _Tp>
539struct greater<experimental::fundamentals_v2::propagate_const<_Tp>>
540{
541  typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type;
542  typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type;
543
544  bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1,
545      const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const
546  {
547    return std::greater<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
548  }
549};
550
551template <class _Tp>
552struct less_equal<experimental::fundamentals_v2::propagate_const<_Tp>>
553{
554  typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type;
555  typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type;
556
557  bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1,
558      const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const
559  {
560    return std::less_equal<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
561  }
562};
563
564template <class _Tp>
565struct greater_equal<experimental::fundamentals_v2::propagate_const<_Tp>>
566{
567  typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type;
568  typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type;
569
570  bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1,
571      const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const
572  {
573    return std::greater_equal<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
574  }
575};
576
577_LIBCPP_END_NAMESPACE_STD
578
579#endif // _LIBCPP_STD_VER > 11
580#endif // _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST
581