folly::propagate_const

A const-propagating wrapper around a pointer-like type.

Synopsis

Declared in <folly/lang/PropagateConst.h>

template<typename Pointer>
class propagate_const;

Description

Mimics std::experimental::propagate_const from C++ Library Fundamentals TS v2: accessing the pointee through a const wrapper yields const access.

Type Aliases

NameDescription
element_type The type of the object pointed to by Pointer.

Member Functions

NameDescription
propagate_const [constructor]Constructors
operator= Assignment operators
get get overloads
operator* Dereference operators
operator-> Member access operators
swap Swap the underlying pointer with another wrapper's.
operator bool Test whether the underlying pointer is non-null.
operator element_type const* Implicitly convert to a const pointer to the pointed-to object.
operator element_type* Implicitly convert to a mutable pointer to the pointed-to object.

Friends

NameDescription
folly::propagate_constA const-propagating wrapper around a pointer-like type.
folly::get_underlyingGrants the const free get_underlying access to the stored pointer.
folly::get_underlyingGrants the free get_underlying access to the stored pointer.

Non-Member Functions

NameDescription
get_underlyingAccess the underlying pointer stored in a const wrapper.
get_underlyingAccess the underlying pointer stored in a mutable wrapper.
operator<=>Three-way-compare two wrappers by their underlying pointers.
operator<=>Three-way-compare a wrapper against a value of another type.
operator==Equality-compare a wrapper against nullptr.
operator==Equality-compare two wrappers by their underlying pointers.
operator==Equality-compare a wrapper against a value of another type.
swapSwap the underlying pointers of two wrappers.