// SingletonHolders.
class SingletonHolderBase {
public:
- virtual ~SingletonHolderBase() {}
+ virtual ~SingletonHolderBase() = default;
virtual TypeDescriptor type() = 0;
virtual bool hasLiveInstance() = 0;
// Mark registration is complete; no more singletons can be
// registered at this point.
void registrationComplete() {
- RequestContext::getStaticContext();
+ RequestContext::saveContext();
std::atexit([](){ SingletonVault::singleton()->destroyInstances(); });
RWSpinLock::WriteHolder wh(&stateMutex_);
private:
template <typename T>
- friend class detail::SingletonHolder;
+ friend struct detail::SingletonHolder;
// The two stages of life for a vault, as mentioned in the class comment.
enum class SingletonVaultState {