Use auto for scope-guard locals v.s. folly::ScopeGuard
[folly.git] / folly / ScopeGuard.h
index 68043c355171d578705bd1caaaf929d8ed70a4a1..8d8e420d04b41ce56304b93a6992117a7b6eec92 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2011-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.
@@ -47,8 +47,7 @@ namespace folly {
  *
  *   // If the db insertion that follows fails, we should
  *   // remove it from memory.
- *   // (You could also declare this as "auto guard = makeGuard(...)")
- *   ScopeGuard guard = makeGuard([&] { friends_.pop_back(); });
+ *   auto guard = makeGuard([&] { friends_.pop_back(); });
  *
  *   // this will throw an exception upon error, which
  *   // makes the ScopeGuard execute UserCont::pop_back()