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