proxygen
folly::propagate_const< Pointer > Class Template Reference

#include <PropagateConst.h>

Public Types

using element_type = _t< std::remove_reference< decltype(*std::declval< Pointer & >())>>
 

Public Member Functions

constexpr propagate_const ()=default
 
FOLLY_CPP14_CONSTEXPR propagate_const (propagate_const &&)=default
 
 propagate_const (propagate_const const &)=delete
 
template<typename OtherPointer , _t< std::enable_if< std::is_constructible< Pointer, OtherPointer && >::value &&!std::is_convertible< OtherPointer &&, Pointer >::value, int >> = 0>
constexpr propagate_const (propagate_const< OtherPointer > &&other)
 
template<typename OtherPointer , _t< std::enable_if< std::is_constructible< Pointer, OtherPointer && >::value &&std::is_convertible< OtherPointer &&, Pointer >::value, int >> = 0>
constexpr propagate_const (propagate_const< OtherPointer > &&other)
 
template<typename OtherPointer , _t< std::enable_if< !detail::is_decay_propagate_const< OtherPointer >::value &&std::is_constructible< Pointer, OtherPointer && >::value &&!std::is_convertible< OtherPointer &&, Pointer >::value, int >> = 0>
constexpr propagate_const (OtherPointer &&other)
 
template<typename OtherPointer , _t< std::enable_if< !detail::is_decay_propagate_const< OtherPointer >::value &&std::is_constructible< Pointer, OtherPointer && >::value &&std::is_convertible< OtherPointer &&, Pointer >::value, int >> = 0>
constexpr propagate_const (OtherPointer &&other)
 
FOLLY_CPP14_CONSTEXPR propagate_constoperator= (propagate_const &&)=default
 
propagate_constoperator= (propagate_const const &)=delete
 
template<typename OtherPointer , typename = _t< std::enable_if<std::is_convertible<OtherPointer&&, Pointer>::value>>>
FOLLY_CPP14_CONSTEXPR propagate_constoperator= (propagate_const< OtherPointer > &&other)
 
template<typename OtherPointer , typename = _t<std::enable_if< !detail::is_decay_propagate_const<OtherPointer>::value && std::is_convertible<OtherPointer&&, Pointer>::value>>>
FOLLY_CPP14_CONSTEXPR propagate_constoperator= (OtherPointer &&other)
 
FOLLY_CPP14_CONSTEXPR void swap (propagate_const &other) noexcept(noexcept(detail::propagate_const_adl::adl_swap(std::declval< Pointer & >(), other.pointer_)))
 
FOLLY_CPP14_CONSTEXPR element_typeget ()
 
constexpr element_type const * get () const
 
constexpr operator bool () const
 
FOLLY_CPP14_CONSTEXPR element_typeoperator* ()
 
constexpr element_type const & operator* () const
 
FOLLY_CPP14_CONSTEXPR element_typeoperator-> ()
 
constexpr element_type const * operator-> () const
 
template<typename OtherPointer = Pointer, typename = _t<std::enable_if< std::is_pointer<OtherPointer>::value || std::is_convertible<OtherPointer, element_type*>::value>>>
FOLLY_CPP14_CONSTEXPR operator element_type * ()
 
template<typename OtherPointer = Pointer, typename = _t<std::enable_if< std::is_pointer<OtherPointer>::value || std::is_convertible<OtherPointer, element_type const*>::value>>>
constexpr operator element_type const * () const
 

Static Private Member Functions

template<typename T >
static constexpr Tget_ (T *t)
 
template<typename T >
static constexpr auto get_ (T &t) -> decltype(t.get())
 

Private Attributes

Pointer pointer_
 

Friends

template<typename OtherPointer >
class propagate_const
 
Pointer & get_underlying (propagate_const &)
 
Pointer const & get_underlying (propagate_const const &)
 

Detailed Description

template<typename Pointer>
class folly::propagate_const< Pointer >

Definition at line 29 of file PropagateConst.h.

Member Typedef Documentation

template<typename Pointer>
using folly::propagate_const< Pointer >::element_type = _t<std::remove_reference<decltype(*std::declval<Pointer&>())>>

Definition at line 64 of file PropagateConst.h.

Constructor & Destructor Documentation

template<typename Pointer>
constexpr folly::propagate_const< Pointer >::propagate_const ( )
default
template<typename Pointer>
FOLLY_CPP14_CONSTEXPR folly::propagate_const< Pointer >::propagate_const ( propagate_const< Pointer > &&  )
default
template<typename Pointer>
folly::propagate_const< Pointer >::propagate_const ( propagate_const< Pointer > const &  )
delete
template<typename Pointer>
template<typename OtherPointer , _t< std::enable_if< std::is_constructible< Pointer, OtherPointer && >::value &&!std::is_convertible< OtherPointer &&, Pointer >::value, int >> = 0>
constexpr folly::propagate_const< Pointer >::propagate_const ( propagate_const< OtherPointer > &&  other)
inlineexplicit

Definition at line 76 of file PropagateConst.h.

References value.

77  : pointer_(static_cast<OtherPointer&&>(other.pointer_)) {}
template<typename Pointer>
template<typename OtherPointer , _t< std::enable_if< std::is_constructible< Pointer, OtherPointer && >::value &&std::is_convertible< OtherPointer &&, Pointer >::value, int >> = 0>
constexpr folly::propagate_const< Pointer >::propagate_const ( propagate_const< OtherPointer > &&  other)
inline

Definition at line 85 of file PropagateConst.h.

References value.

86  : pointer_(static_cast<OtherPointer&&>(other.pointer_)) {}
template<typename Pointer>
template<typename OtherPointer , _t< std::enable_if< !detail::is_decay_propagate_const< OtherPointer >::value &&std::is_constructible< Pointer, OtherPointer && >::value &&!std::is_convertible< OtherPointer &&, Pointer >::value, int >> = 0>
constexpr folly::propagate_const< Pointer >::propagate_const ( OtherPointer &&  other)
inlineexplicit

Definition at line 95 of file PropagateConst.h.

References value.

96  : pointer_(static_cast<OtherPointer&&>(other)) {}
template<typename Pointer>
template<typename OtherPointer , _t< std::enable_if< !detail::is_decay_propagate_const< OtherPointer >::value &&std::is_constructible< Pointer, OtherPointer && >::value &&std::is_convertible< OtherPointer &&, Pointer >::value, int >> = 0>
constexpr folly::propagate_const< Pointer >::propagate_const ( OtherPointer &&  other)
inline

Definition at line 105 of file PropagateConst.h.

References FOLLY_CPP14_CONSTEXPR, and value.

106  : pointer_(static_cast<OtherPointer&&>(other)) {}

Member Function Documentation

template<typename Pointer>
FOLLY_CPP14_CONSTEXPR element_type* folly::propagate_const< Pointer >::get ( )
inline

Definition at line 137 of file PropagateConst.h.

137  {
138  return get_(pointer_);
139  }
static constexpr T * get_(T *t)
template<typename Pointer>
constexpr element_type const* folly::propagate_const< Pointer >::get ( ) const
inline

Definition at line 141 of file PropagateConst.h.

141  {
142  return get_(pointer_);
143  }
static constexpr T * get_(T *t)
template<typename Pointer>
template<typename T >
static constexpr T* folly::propagate_const< Pointer >::get_ ( T t)
inlinestaticprivate

Definition at line 190 of file PropagateConst.h.

References folly::pushmi::detail::t.

190  {
191  return t;
192  }
template<typename Pointer>
template<typename T >
static constexpr auto folly::propagate_const< Pointer >::get_ ( T t) -> decltype(t.get())
inlinestaticprivate

Definition at line 194 of file PropagateConst.h.

References folly::pushmi::detail::t.

194  {
195  return t.get();
196  }
template<typename Pointer>
constexpr folly::propagate_const< Pointer >::operator bool ( ) const
inlineexplicit

Definition at line 145 of file PropagateConst.h.

145  {
146  return static_cast<bool>(pointer_);
147  }
template<typename Pointer>
template<typename OtherPointer = Pointer, typename = _t<std::enable_if< std::is_pointer<OtherPointer>::value || std::is_convertible<OtherPointer, element_type*>::value>>>
FOLLY_CPP14_CONSTEXPR folly::propagate_const< Pointer >::operator element_type * ( )
inline

Definition at line 170 of file PropagateConst.h.

References value.

170  {
171  return get();
172  }
template<typename Pointer>
template<typename OtherPointer = Pointer, typename = _t<std::enable_if< std::is_pointer<OtherPointer>::value || std::is_convertible<OtherPointer, element_type const*>::value>>>
constexpr folly::propagate_const< Pointer >::operator element_type const * ( ) const
inline

Definition at line 179 of file PropagateConst.h.

179  {
180  return get();
181  }
template<typename Pointer>
FOLLY_CPP14_CONSTEXPR element_type& folly::propagate_const< Pointer >::operator* ( )
inline

Definition at line 149 of file PropagateConst.h.

149  {
150  return *get();
151  }
template<typename Pointer>
constexpr element_type const& folly::propagate_const< Pointer >::operator* ( ) const
inline

Definition at line 153 of file PropagateConst.h.

153  {
154  return *get();
155  }
template<typename Pointer>
FOLLY_CPP14_CONSTEXPR element_type* folly::propagate_const< Pointer >::operator-> ( )
inline

Definition at line 157 of file PropagateConst.h.

157  {
158  return get();
159  }
template<typename Pointer>
constexpr element_type const* folly::propagate_const< Pointer >::operator-> ( ) const
inline

Definition at line 161 of file PropagateConst.h.

References value.

161  {
162  return get();
163  }
template<typename Pointer>
FOLLY_CPP14_CONSTEXPR propagate_const& folly::propagate_const< Pointer >::operator= ( propagate_const< Pointer > &&  )
default
template<typename Pointer>
propagate_const& folly::propagate_const< Pointer >::operator= ( propagate_const< Pointer > const &  )
delete
template<typename Pointer>
template<typename OtherPointer , typename = _t< std::enable_if<std::is_convertible<OtherPointer&&, Pointer>::value>>>
FOLLY_CPP14_CONSTEXPR propagate_const& folly::propagate_const< Pointer >::operator= ( propagate_const< OtherPointer > &&  other)
inline

Definition at line 115 of file PropagateConst.h.

116  {
117  pointer_ = static_cast<OtherPointer&&>(other.pointer_);
118  }
template<typename Pointer>
template<typename OtherPointer , typename = _t<std::enable_if< !detail::is_decay_propagate_const<OtherPointer>::value && std::is_convertible<OtherPointer&&, Pointer>::value>>>
FOLLY_CPP14_CONSTEXPR propagate_const& folly::propagate_const< Pointer >::operator= ( OtherPointer &&  other)
inline

Definition at line 125 of file PropagateConst.h.

125  {
126  pointer_ = static_cast<OtherPointer&&>(other);
127  return *this;
128  }
template<typename Pointer>
FOLLY_CPP14_CONSTEXPR void folly::propagate_const< Pointer >::swap ( propagate_const< Pointer > &  other)
inlinenoexcept

Definition at line 130 of file PropagateConst.h.

References folly::detail::propagate_const_adl::adl_swap().

133  {
135  }
auto adl_swap(T &a, T &b) noexcept(noexcept(swap(a, b))) -> decltype(swap(a, b))

Friends And Related Function Documentation

template<typename Pointer>
Pointer& get_underlying ( propagate_const< Pointer > &  obj)
friend

Definition at line 32 of file PropagateConst.h.

32  {
33  return obj.pointer_;
34 }
template<typename Pointer>
Pointer const& get_underlying ( propagate_const< Pointer > const &  obj)
friend

Definition at line 37 of file PropagateConst.h.

37  {
38  return obj.pointer_;
39 }
template<typename Pointer>
template<typename OtherPointer >
friend class propagate_const
friend

Definition at line 187 of file PropagateConst.h.

Member Data Documentation

template<typename Pointer>
Pointer folly::propagate_const< Pointer >::pointer_
private

Definition at line 198 of file PropagateConst.h.

Referenced by folly::get_underlying().


The documentation for this class was generated from the following file: