Template Class SharedPointer

Inheritance Relationships

Base Type

  • public DesignPattern::Creation< SharedPointer< T >, SharedPointerError >

Class Documentation

template<typename T>
class SharedPointer : public DesignPattern::Creation<SharedPointer<T>, SharedPointerError>

DesignPattern::Creation offers us a create method which forwards the arguments to the constructor. Use this class like in the code example below.

// cxx::expected
auto sharedPointer = SharedPointer<int>::Create(mySharedChunk, 123);
if ( sharedPointer.has_error() ) {
    // ...
} else {
    // ...
}

Public Types

using CreationPattern_t = DesignPattern::Creation<SharedPointer<T>, SharedPointerError>

Public Functions

SharedPointer() = default
SharedPointer(const SharedPointer&) = default
SharedPointer(SharedPointer&&) = default
~SharedPointer() noexcept
SharedPointer &operator=(const SharedPointer&) noexcept
SharedPointer &operator=(SharedPointer&&) noexcept
T *get() noexcept
const T *get() const noexcept
T *operator->() noexcept
const T *operator->() const noexcept
T &operator*() noexcept
const T &operator*() const noexcept
explicit operator bool() const noexcept

Friends

friend class DesignPattern::Creation< SharedPointer< T >, SharedPointerError >