/*
- * 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.
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);
}
: 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_;
return snapshot;
}
-}
-}
+} // namespace observer
+} // namespace folly