24#ifndef JBCOE_PROPAGATE_CONST_INCLUDED
25#define JBCOE_PROPAGATE_CONST_INCLUDED
33#define PROPAGATE_CONST_CONSTEXPR constexpr
36#define PROPAGATE_CONST_CONSTEXPR
37#define PROPAGATE_CONST_HAS_NO_EXPRESSION_SFINAE
39#define PROPAGATE_CONST_CONSTEXPR constexpr
44namespace experimental {
45inline namespace fundamentals_v2 {
49 using element_type =
typename std::pointer_traits<T>::element_type;
86#ifdef PROPAGATE_CONST_HAS_NO_EXPRESSION_SFINAE
90 template <class U, class = enable_if_t<is_constructible<T, U&&>::value>>
97 class = enable_if_t<is_constructible<T, U&&>::value &&
98 !is_propagate_const<decay_t<U>>
::value>>
107 template <class U, enable_if_t<!is_convertible<U&&, T>::value &&
108 is_constructible<T, U&&>::value,
113 template <class U, enable_if_t<is_convertible<U&&, T>::value &&
114 is_constructible<T, U&&>::value,
118 template <class U, enable_if_t<!is_convertible<U&&, T>::value &&
119 is_constructible<T, U&&>::value &&
120 !is_propagate_const<decay_t<U>>
::value,
124 template <class U, enable_if_t<is_convertible<U&&, T>::value &&
125 is_constructible<T, U&&>::value &&
126 !is_propagate_const<decay_t<U>>
::value,
138 t_ = std::move(pu.t_);
143 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
153 template <
class T_ = T,
class U = enable_if_t<is_convertible<
167 template <
class T_ = T,
168 class U = enable_if_t<is_convertible<T_, element_type*>::value>>
180 noexcept(
swap(declval<T&>(), declval<T&>()))) {
197 return pt.
t_ ==
nullptr;
201 return nullptr == pu.
t_;
205 return pt.
t_ !=
nullptr;
209 return nullptr != pu.
t_;
215 return pt.
t_ == pu.
t_;
221 return pt.
t_ != pu.
t_;
227 return pt.
t_ < pu.
t_;
233 return pt.
t_ > pu.
t_;
239 return pt.
t_ <= pu.
t_;
245 return pt.
t_ >= pu.
t_;
249 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
255 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
261 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
267 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
273 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
279 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
285 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
291 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
297 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
303 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
309 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
315 class = enable_if_t<!is_propagate_const<decay_t<U>>
::value>>
325 noexcept(
swap(declval<T&>(), declval<T&>())))
327 swap(pt.underlying_ptr(), pu.underlying_ptr());
335struct hash<experimental::fundamentals_v2::propagate_const<T>> {
341 return std::hash<T>()(pc.
t_);
347struct equal_to<experimental::fundamentals_v2::propagate_const<T>> {
355 return std::equal_to<T>()(pc1.
t_, pc2.
t_);
360struct not_equal_to<experimental::fundamentals_v2::propagate_const<T>> {
368 return std::not_equal_to<T>()(pc1.
t_, pc2.
t_);
373struct less<experimental::fundamentals_v2::propagate_const<T>> {
381 return std::less<T>()(pc1.
t_, pc2.
t_);
386struct greater<experimental::fundamentals_v2::propagate_const<T>> {
394 return std::greater<T>()(pc1.
t_, pc2.
t_);
399struct less_equal<experimental::fundamentals_v2::propagate_const<T>> {
407 return std::less_equal<T>()(pc1.
t_, pc2.
t_);
412struct greater_equal<experimental::fundamentals_v2::propagate_const<T>> {
420 return std::greater_equal<T>()(pc1.
t_, pc2.
t_);
426#undef PROPAGATE_CONST_CONSTEXPR
float value(const T *src, size_t ch)
friend PROPAGATE_CONST_CONSTEXPR bool operator<(const propagate_const &pt, const propagate_const< U > &pu)
friend PROPAGATE_CONST_CONSTEXPR bool operator<=(const propagate_const &pt, const U &u)
friend PROPAGATE_CONST_CONSTEXPR bool operator<(const U &u, const propagate_const &pu)
friend PROPAGATE_CONST_CONSTEXPR bool operator>=(const propagate_const &pt, const U &u)
PROPAGATE_CONST_CONSTEXPR propagate_const(U &&u)
friend PROPAGATE_CONST_CONSTEXPR bool operator==(const propagate_const &pt, const U &u)
PROPAGATE_CONST_CONSTEXPR const element_type & operator*() const
static const element_type * get_pointer(const U *u)
friend PROPAGATE_CONST_CONSTEXPR bool operator!=(const propagate_const &pt, const U &u)
PROPAGATE_CONST_CONSTEXPR void swap(propagate_const &pt) noexcept(noexcept(swap(declval< T & >(), declval< T & >())))
PROPAGATE_CONST_CONSTEXPR element_type * get()
friend PROPAGATE_CONST_CONSTEXPR bool operator==(const U &u, const propagate_const &pu)
PROPAGATE_CONST_CONSTEXPR propagate_const()=default
friend PROPAGATE_CONST_CONSTEXPR bool operator>(const propagate_const &pt, const propagate_const< U > &pu)
friend PROPAGATE_CONST_CONSTEXPR bool operator==(const propagate_const &pt, nullptr_t)
friend PROPAGATE_CONST_CONSTEXPR bool operator>(const propagate_const &pt, const U &u)
PROPAGATE_CONST_CONSTEXPR const element_type * get() const
propagate_const & operator=(const propagate_const &p)=delete
propagate_const(const propagate_const &p)=delete
static const element_type * get_pointer(const U &u)
friend PROPAGATE_CONST_CONSTEXPR bool operator<=(const propagate_const &pt, const propagate_const< U > &pu)
friend PROPAGATE_CONST_CONSTEXPR bool operator!=(const propagate_const &pt, const propagate_const< U > &pu)
friend PROPAGATE_CONST_CONSTEXPR bool operator<(const propagate_const &pt, const U &u)
PROPAGATE_CONST_CONSTEXPR propagate_const & operator=(U &&u)
friend PROPAGATE_CONST_CONSTEXPR bool operator!=(const U &u, const propagate_const &pu)
friend PROPAGATE_CONST_CONSTEXPR bool operator==(nullptr_t, const propagate_const &pu)
static element_type * get_pointer(U *u)
PROPAGATE_CONST_CONSTEXPR const element_type * operator->() const
friend PROPAGATE_CONST_CONSTEXPR bool operator!=(nullptr_t, const propagate_const &pu)
friend PROPAGATE_CONST_CONSTEXPR bool operator<=(const U &u, const propagate_const &pu)
static element_type * get_pointer(U &u)
PROPAGATE_CONST_CONSTEXPR element_type * operator->()
friend PROPAGATE_CONST_CONSTEXPR bool operator!=(const propagate_const &pt, nullptr_t)
PROPAGATE_CONST_CONSTEXPR propagate_const(propagate_const< U > &&pu)
PROPAGATE_CONST_CONSTEXPR propagate_const & operator=(propagate_const< U > &&pu)
typename std::pointer_traits< T >::element_type element_type
PROPAGATE_CONST_CONSTEXPR propagate_const(propagate_const &&p)=default
PROPAGATE_CONST_CONSTEXPR element_type & operator*()
friend PROPAGATE_CONST_CONSTEXPR bool operator>=(const propagate_const &pt, const propagate_const< U > &pu)
friend PROPAGATE_CONST_CONSTEXPR bool operator==(const propagate_const &pt, const propagate_const< U > &pu)
PROPAGATE_CONST_CONSTEXPR propagate_const & operator=(propagate_const &&p)=default
friend PROPAGATE_CONST_CONSTEXPR bool operator>=(const U &u, const propagate_const &pu)
friend PROPAGATE_CONST_CONSTEXPR bool operator>(const U &u, const propagate_const &pu)
PROPAGATE_CONST_CONSTEXPR void swap(propagate_const< T > &pt, propagate_const< T > &pu) noexcept(noexcept(swap(declval< T & >(), declval< T & >())))
#define PROPAGATE_CONST_CONSTEXPR
experimental::fundamentals_v2::propagate_const< T > second_argument_type
experimental::fundamentals_v2::propagate_const< T > first_argument_type
bool operator()(const experimental::fundamentals_v2::propagate_const< T > &pc1, const experimental::fundamentals_v2::propagate_const< T > &pc2) const
experimental::fundamentals_v2::propagate_const< T > first_argument_type
experimental::fundamentals_v2::propagate_const< T > second_argument_type
bool operator()(const experimental::fundamentals_v2::propagate_const< T > &pc1, const experimental::fundamentals_v2::propagate_const< T > &pc2) const
bool operator()(const experimental::fundamentals_v2::propagate_const< T > &pc1, const experimental::fundamentals_v2::propagate_const< T > &pc2) const
experimental::fundamentals_v2::propagate_const< T > second_argument_type
experimental::fundamentals_v2::propagate_const< T > first_argument_type
experimental::fundamentals_v2::propagate_const< T > argument_type
bool operator()(const experimental::fundamentals_v2::propagate_const< T > &pc) const
bool operator()(const experimental::fundamentals_v2::propagate_const< T > &pc1, const experimental::fundamentals_v2::propagate_const< T > &pc2) const
experimental::fundamentals_v2::propagate_const< T > second_argument_type
experimental::fundamentals_v2::propagate_const< T > first_argument_type
experimental::fundamentals_v2::propagate_const< T > second_argument_type
experimental::fundamentals_v2::propagate_const< T > first_argument_type
bool operator()(const experimental::fundamentals_v2::propagate_const< T > &pc1, const experimental::fundamentals_v2::propagate_const< T > &pc2) const
bool operator()(const experimental::fundamentals_v2::propagate_const< T > &pc1, const experimental::fundamentals_v2::propagate_const< T > &pc2) const
experimental::fundamentals_v2::propagate_const< T > second_argument_type
experimental::fundamentals_v2::propagate_const< T > first_argument_type