Get *=default*ed default constructors
[folly.git] / folly / Singleton.h
index c9868d4d5385af3feb8b58249bca01e69dbf7313..88eed3426b302c03479d01477a3a32c208bfcc2f 100644 (file)
@@ -188,7 +188,7 @@ class TypeDescriptorHasher {
 // SingletonHolders.
 class SingletonHolderBase {
  public:
-  virtual ~SingletonHolderBase() {}
+  virtual ~SingletonHolderBase() = default;
 
   virtual TypeDescriptor type() = 0;
   virtual bool hasLiveInstance() = 0;
@@ -306,7 +306,7 @@ class SingletonVault {
   // 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_);
@@ -375,7 +375,7 @@ class SingletonVault {
 
  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 {