Fix copyright lines
[folly.git] / folly / experimental / observer / Observer-inl.h
index eb1338d70f355f469a6c1ba6fb99b59b522a6253..1c549829e5a8332979a09e41996f4662c2330f0c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2016-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,10 +38,10 @@ Observer<observer_detail::ResultOfUnwrapSharedPtr<F>> makeObserver(
     F&& creator) {
   auto core = observer_detail::Core::
       create([creator = std::forward<F>(creator)]() mutable {
-        return std::static_pointer_cast<void>(creator());
+        return std::static_pointer_cast<const void>(creator());
       });
 
-  observer_detail::ObserverManager::scheduleRefreshNewVersion(core);
+  observer_detail::ObserverManager::initCore(core);
 
   return Observer<observer_detail::ResultOfUnwrapSharedPtr<F>>(core);
 }
@@ -58,6 +58,10 @@ TLObserver<T>::TLObserver(Observer<T> observer)
     : observer_(observer),
       snapshot_([&] { return new Snapshot<T>(observer_.getSnapshot()); }) {}
 
+template <typename T>
+TLObserver<T>::TLObserver(const TLObserver<T>& other)
+    : TLObserver(other.observer_) {}
+
 template <typename T>
 const Snapshot<T>& TLObserver<T>::getSnapshotRef() const {
   auto& snapshot = *snapshot_;
@@ -68,5 +72,5 @@ const Snapshot<T>& TLObserver<T>::getSnapshotRef() const {
 
   return snapshot;
 }
-}
-}
+} // namespace observer
+} // namespace folly