A compiler-support agnostic implementation of std::propagate_const
More...
#include <marvin_PropagateConst.h>
Public Member Functions | |
constexpr | PropagateConst ()=default |
constexpr | PropagateConst (PropagateConst &&p)=default |
template<class U> requires std::is_constructible<T, U>::value && std::is_convertible<U, T>::value | |
constexpr | PropagateConst (PropagateConst< U > &&pu) |
template<class U> requires std::is_constructible<T, U>::value && (!std::is_convertible<U, T>::value) | |
constexpr | PropagateConst (PropagateConst< U > &&pu) |
template<class U> requires std::is_constructible<T, U>::value && (!is_specialisation<std::decay_t<U>>::value) | |
constexpr | PropagateConst (U &&u) |
template<class U> requires std::is_constructible<T, U>::value && (!is_specialisation<std::decay_t<U>>::value) && (!std::is_convertible<U, T>::value) | |
constexpr | PropagateConst (U &&u) |
constexpr PropagateConst & | operator= (PropagateConst &&)=default |
template<class U> requires std::is_convertible<U, T>::value | |
constexpr PropagateConst & | operator= (PropagateConst< U > &&pu) |
template<class U> requires std::is_convertible<U, T>::value && (!is_specialisation<std::decay_t<U>>::value) | |
constexpr PropagateConst & | operator= (U &&u) |
PropagateConst & | operator= (const PropagateConst &other)=delete |
constexpr void | swap (PropagateConst &pt) noexcept |
constexpr element_type * | get () |
constexpr const element_type * | get () const |
constexpr | operator bool () const |
constexpr element_type & | operator* () |
constexpr const element_type & | operator* () const |
constexpr element_type * | operator-> () |
constexpr const element_type * | operator-> () const |
constexpr | operator element_type * () |
constexpr | operator const element_type * () |
Friends | |
template<class U> | |
constexpr bool | operator== (const PropagateConst< U > &, std::nullptr_t) |
template<class U> | |
constexpr bool | operator== (std::nullptr_t, const PropagateConst< U > &) |
template<class U> | |
constexpr bool | operator!= (const PropagateConst< U > &, std::nullptr_t) |
template<class U> | |
constexpr bool | operator!= (std::nullptr_t, const PropagateConst< U > &) |
template<class U> | |
constexpr bool | operator== (const PropagateConst< T > &pt, const PropagateConst< U > &pu) |
template<class U> | |
constexpr bool | operator!= (const PropagateConst< T > &pt, const PropagateConst< U > &pu) |
template<class U> | |
constexpr bool | operator< (const PropagateConst< T > &pt, const PropagateConst< U > &pu) |
template<class U> | |
constexpr bool | operator> (const PropagateConst< T > &pt, const PropagateConst< U > &pu) |
template<class U> | |
constexpr bool | operator<= (const PropagateConst< T > &pt, const PropagateConst< U > &pu) |
template<class U> | |
constexpr bool | operator>= (const PropagateConst< T > &pt, const PropagateConst< U > &pu) |
template<class U> | |
constexpr bool | operator== (const PropagateConst< T > &pt, const U &u) |
template<class U> | |
constexpr bool | operator!= (const PropagateConst< T > &pt, const U &u) |
template<class U> | |
constexpr bool | operator== (const T &t, const PropagateConst< U > &pu) |
template<class U> | |
constexpr bool | operator!= (const T &t, const PropagateConst< U > &pu) |
template<class U> | |
constexpr bool | operator< (const PropagateConst< T > &pt, const U &u) |
template<class U> | |
constexpr bool | operator> (const PropagateConst< T > &pt, const U &u) |
template<class U> | |
constexpr bool | operator<= (const PropagateConst< T > &pt, const U &u) |
template<class U> | |
constexpr bool | operator>= (const PropagateConst< T > &pt, const U &u) |
template<class U> | |
constexpr bool | operator< (const T &t, const PropagateConst< U > &pu) |
template<class U> | |
constexpr bool | operator> (const T &t, const PropagateConst< U > &pu) |
template<class U> | |
constexpr bool | operator<= (const T &t, const PropagateConst< U > &pu) |
template<class U> | |
constexpr bool | operator>= (const T &t, const PropagateConst< U > &pu) |
A compiler-support agnostic implementation of std::propagate_const
The raison d'etre being that certain popular compilers (cough Apple-Clang cough) are horrifically slow at implementing stdlib features, and std::propagate_const
is pretty desirable for anything using a PImpl
pattern.
For more information about what std::propagate_const
actually does, see here: https://en.cppreference.com/w/cpp/experimental/propagate_const
|
constexprdefault |
Constructs a PropagateConst, default initialising the internal pointer variable.
|
constexprdefault |
Explicitly defaulted move constructor that move constructs the internal pointer variable with p
p | Another PropagateConst object to move from. |
|
inlineconstexpr |
Initialises the internal pointer variable as if from the expression std::move(pu.t_)
. Implicit if std::is_convertible_v<U, T>
pu | Another PropagateConst object of a different specialization to move from. |
|
inlineexplicitconstexpr |
Initialises the internal pointer variable as if from the expression std::move(pu.t_)
. Explicit if !std::is_convertible_v<U, T>
pu | Another PropagateConst object of a different specialization to move from. |
|
inlineconstexpr |
Initialises the internal pointer variable with the expression std::forward<U>(u)
. Implicit if std::is_convertible_v<U, T>
.
u | Another object to initialise the internal pointer variable with. |
|
inlineexplicitconstexpr |
Initialises the internal pointer variable with the expression std::forward<U>(u)
. Explicit if !std::is_convertible_v<U, T>
.
u | Another object to initialise the internal pointer variable with. |
|
inlineconstexpr |
Returns a pointer to the object pointed to by the wrapped internal pointer-like variable.
.get()
call on the internal pointer variable.
|
inlineconstexpr |
Returns a pointer to the object pointed to by the wrapped internal pointer-like variable.
.get()
call on the internal pointer variable.
|
inlineexplicitconstexpr |
Checks whether the internal pointer variable is null.
true
if the internal pointer variable is not null, otherwise false
.
|
inlineconstexpr |
Provides implicit conversion to const element_type*
|
inlineconstexpr |
Provides implicit conversion to element_type*
|
inlineconstexpr |
Dereferences the internal pointer variable - undefined behaviour if its null!
|
inlineconstexpr |
Dereferences the internal pointer variable - undefined behaviour if its null!
|
inlineconstexpr |
Provides access into the internal pointer variable - undefined behaviour if its null!
|
inlineconstexpr |
Provides access into the internal pointer variable - undefined behaviour if its null!
|
delete |
Deleted - non copyable.
|
constexprdefault |
Explicitly defaulted move-assign that move-assigns the internal pointer variable from other
's internal pointer variable.
|
inlineconstexpr |
Assigns a std::move
of pu
's internal pointer variable to this instance's internal pointer variable.
pu | Another PropagateConst object of a different specialization to move from. |
*this
.
|
inlineconstexpr |
Assigns a std::forward
of u
to the internal pointer variable.
u | Another object to assign to the internal pointer variable. |
*this
.
|
inlineconstexprnoexcept |
Swaps the internal pointer variable with that of pt. UB if lvalues of T do not satisfy swappable.
pt | Another PropagateConst object to swap with. |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |