Template Class FriendSingleton

Class Documentation

template<class Type>
class FriendSingleton

CE::State::FriendSingleton (Compile Time Unsafe) For true singleton creation.

i.e. instantiation is private/protected Type must friend CE::State::FriendSingleton<Type> so construction is accessible in this template’s context. Deletion by std::unique_ptr still requires an accessible destructor. The initialization, publication, retry, borrowed-lifetime, and operation contracts are the same as CE::State::Singleton.

Example usage: class Foo : public CE::State::FriendSingleton<Foo> { friend class CE::State::FriendSingleton<Foo>; Foo() = default; // private constructor, can’t be instantiated public: // interface };

Public Static Functions

static inline Type *get_existing() noexcept

Declaration: [[nodiscard]]

template<typename ...Args>
static inline Type &initialize(Args&&... args)
template<typename ...Args>
static inline Type &get(Args&&... args)

Protected Functions

FriendSingleton() = default