Codemod folly::make_unique to std::make_unique
[folly.git] / folly / Try.h
index 1f08e27e3a6fca3160679b13217394fc9f3ef4b1..86a5dee003c9b37b98e4312c900fd96943ac0aba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ class TryException : public std::logic_error {
 
 class UsingUninitializedTry : public TryException {
  public:
-  UsingUninitializedTry() : TryException("Using unitialized try") {}
+  UsingUninitializedTry() : TryException("Using uninitialized try") {}
 };
 
 /*
@@ -93,8 +93,8 @@ class Try {
    * @param e The exception_wrapper
    */
   explicit Try(exception_wrapper e)
-    : contains_(Contains::EXCEPTION),
-      e_(folly::make_unique<exception_wrapper>(std::move(e))) {}
+      : contains_(Contains::EXCEPTION),
+        e_(std::make_unique<exception_wrapper>(std::move(e))) {}
 
   /*
    * DEPRECATED
@@ -108,9 +108,9 @@ class Try {
     try {
       std::rethrow_exception(ep);
     } catch (const std::exception& e) {
-      e_ = folly::make_unique<exception_wrapper>(std::current_exception(), e);
+      e_ = std::make_unique<exception_wrapper>(std::current_exception(), e);
     } catch (...) {
-      e_ = folly::make_unique<exception_wrapper>(std::current_exception());
+      e_ = std::make_unique<exception_wrapper>(std::current_exception());
     }
   }
 
@@ -266,8 +266,8 @@ class Try<void> {
    * @param e The exception_wrapper
    */
   explicit Try(exception_wrapper e)
-    : hasValue_(false),
-      e_(folly::make_unique<exception_wrapper>(std::move(e))) {}
+      : hasValue_(false),
+        e_(std::make_unique<exception_wrapper>(std::move(e))) {}
 
   /*
    * DEPRECATED
@@ -280,9 +280,9 @@ class Try<void> {
     try {
       std::rethrow_exception(ep);
     } catch (const std::exception& e) {
-      e_ = folly::make_unique<exception_wrapper>(std::current_exception(), e);
+      e_ = std::make_unique<exception_wrapper>(std::current_exception(), e);
     } catch (...) {
-      e_ = folly::make_unique<exception_wrapper>(std::current_exception());
+      e_ = std::make_unique<exception_wrapper>(std::current_exception());
     }
   }
 
@@ -290,7 +290,7 @@ class Try<void> {
   Try& operator=(const Try<void>& t) {
     hasValue_ = t.hasValue_;
     if (t.e_) {
-      e_ = folly::make_unique<exception_wrapper>(*t.e_);
+      e_ = std::make_unique<exception_wrapper>(*t.e_);
     }
     return *this;
   }