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