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