folly: avoid compile warning/failure due to lvalue-to-rvalue conversion
[folly.git] / folly / io / async / EventBaseLocal.h
index f7276375e51ba7696bc05cdca91f03f257027c52..8e4bdce3b77b4b98bb6b90a75e47f84db07cb8ae 100644 (file)
@@ -31,7 +31,7 @@ namespace detail {
 class EventBaseLocalBase : public EventBaseLocalBaseBase, boost::noncopyable {
  public:
   EventBaseLocalBase() {}
-  virtual ~EventBaseLocalBase();
+  ~EventBaseLocalBase() override;
   void erase(EventBase& evb);
   void onEventBaseDestruction(EventBase& evb) override;
 
@@ -44,7 +44,7 @@ class EventBaseLocalBase : public EventBaseLocalBaseBase, boost::noncopyable {
   uint64_t key_{keyCounter_++};
 };
 
-}
+} // namespace detail
 
 /**
  * A storage abstraction for data that should be tied to an EventBase.
@@ -63,13 +63,14 @@ class EventBaseLocalBase : public EventBaseLocalBaseBase, boost::noncopyable {
  *   Foo& foo = myFoo.getOrCreateFn(evb, [] () { return new Foo(3, 4); })
  *
  * The objects will be deleted when the EventBaseLocal or the EventBase is
- * destructed (whichever comes first).  All methods are thread-safe.
+ * destructed (whichever comes first). All methods must be called from the
+ * EventBase thread.
  *
  * The user is responsible for throwing away invalid references/ptrs returned
  * by the get() method after set/erase is called.  If shared ownership is
  * needed, use a EventBaseLocal<shared_ptr<...>>.
  */
-template<typename T>
+template <typename T>
 class EventBaseLocal : public detail::EventBaseLocalBase {
  public:
   EventBaseLocal(): EventBaseLocalBase() {}
@@ -115,5 +116,4 @@ class EventBaseLocal : public detail::EventBaseLocalBase {
   }
 };
 
-
-}
+} // namespace folly