Class Reference::To
-
template<class Type, bool active = true>
class To Shared pointer to Reference::Able object.
This smart pointer deletes a Reference::Able object when its reference count reaches zero, and is also invalidated when its target is destroyed.
For usage examples, see Reference::To smart pointer
- Template Parameters:
Type – the child of Reference::Able to which this pointer can point. If Type is a base class, then this pointer can also point to derived types
active – When true, this smart pointer behaves like a std::shared_ptr; when false, this pointer is like a std::weak_ptr.
Public Functions
-
constexpr To() = default
Default constructor.
-
~To()
Destructor.
-
template<typename U = Type>
inline std::enable_if<!std::is_const<U>::value, bool>::type operator==(U *ptr) const Comparison operator.
This overloaded operator is
prioritized over
operator==(Type*, Type*)<built-in>enabled only if Type is not const (e.g. Reference::To<const T>)
-
template<typename U = Type>
inline std::enable_if<!std::is_const<U>::value, bool>::type operator!=(U *ptr) const Comparison operator.
This overloaded operator is
prioritized over
operator!=(Type*, Type*)<built-in>enabled only if Type is not const (e.g. Reference::To<const T>)
-
bool operator==(std::nullptr_t) const
Comparison operator.
This version is prioritized over
operator!=(Type*, Type*)<built-in>
-
bool operator!=(std::nullptr_t) const
Comparison operator.
This version is prioritized over
operator!=(Type*, Type*)<built-in>
-
bool operator!() const
Returns true if reference is null.
-
operator bool() const
Returns true if reference is other than null.
-
std::string name() const
Return the name of the object, as returned by typeid.