5#ifndef INKSCAPE_UTIL_STATICS_BIN_H
6#define INKSCAPE_UTIL_STATICS_BIN_H
12class StaticHolderBase;
95template <
typename... Ts>
98template <
typename Deps>
101template <
typename T,
typename... Ts>
106 T::getStaticHolder();
110template <
typename T,
typename Deps = Depends<>>
116 template <
typename... Args>
119 [[unlikely]]
if (!
opt) {
120 opt.emplace(std::forward<Args>(args)...);
133 return opt.has_value();
142 std::optional<ConstructibleT>
opt;
145template <
typename T,
typename Deps = Depends<>>
152 template <
typename... Args>
153 static T &
get(Args&&... args)
static StaticHolder< T, Deps > & getStaticHolder()
EnableSingleton(EnableSingleton const &)=delete
EnableSingleton()=default
EnableSingleton & operator=(EnableSingleton const &)=delete
static T & get(Args &&... args)
StaticHolderBase & operator=(StaticHolderBase const &)=delete
StaticHolderBase *const next
StaticHolderBase(StaticHolderBase const &)=delete
virtual bool active() const =0
std::optional< ConstructibleT > opt
bool active() const override
The following system provides a way of dealing with statics/singletons with unusual lifetime requirem...
static StaticsBin & get()
Miscellaneous supporting code.