/*
- * 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.
class UsingUninitializedTry : public TryException {
public:
- UsingUninitializedTry() : TryException("Using unitialized try") {}
+ UsingUninitializedTry() : TryException("Using uninitialized 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
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());
}
}
* @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
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());
}
}
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;
}