#pragma once
#include <folly/Utility.h>
#include <folly/functional/Invoke.h>
#include <stdexcept>
#include <tuple>
#include <utility>
namespace folly {
namespace detail {
template <class T>
TryBase<T>::TryBase(TryBase<T>&& t) noexcept(
std::is_nothrow_move_constructible<T>::value)
: … { … }
template <class T>
TryBase<T>& TryBase<T>::operator=(TryBase<T>&& t) noexcept(
std::is_nothrow_move_constructible<T>::value) { … }
template <class T>
TryBase<T>::TryBase(const TryBase<T>& t) noexcept(
std::is_nothrow_copy_constructible<T>::value) { … }
template <class T>
TryBase<T>& TryBase<T>::operator=(const TryBase<T>& t) noexcept(
std::is_nothrow_copy_constructible<T>::value) { … }
template <class T>
void TryBase<T>::destroy() noexcept { … }
template <class T>
template <class T2>
TryBase<T>::TryBase(typename std::enable_if<
std::is_same<Unit, T2>::value,
Try<void> const&>::type t) noexcept
: contains_(Contains::NOTHING) { … }
template <class T>
TryBase<T>::~TryBase() { … }
}
Try<void>::Try(const Try<Unit>& t) noexcept : … { … }
template <typename T>
template <typename... Args>
T& Try<T>::emplace(Args&&... args) noexcept(
std::is_nothrow_constructible<T, Args&&...>::value) { … }
template <typename T>
template <typename... Args>
exception_wrapper& Try<T>::emplaceException(Args&&... args) noexcept(
std::is_nothrow_constructible<exception_wrapper, Args&&...>::value) { … }
template <class T>
T& Try<T>::value() & { … }
template <class T>
T&& Try<T>::value() && { … }
template <class T>
const T& Try<T>::value() const& { … }
template <class T>
const T&& Try<T>::value() const&& { … }
template <class T>
template <class U>
T Try<T>::value_or(U&& defaultValue) const& { … }
template <class T>
template <class U>
T Try<T>::value_or(U&& defaultValue) && { … }
template <class T>
void Try<T>::throwUnlessValue() const { … }
template <class T>
void Try<T>::throwIfFailed() const { … }
Try<void>& Try<void>::operator=(const Try<void>& t) noexcept { … }
template <typename... Args>
exception_wrapper& Try<void>::emplaceException(Args&&... args) noexcept(
std::is_nothrow_constructible<exception_wrapper, Args&&...>::value) { … }
void Try<void>::throwIfFailed() const { … }
void Try<void>::throwUnlessValue() const { … }
template <typename F>
typename std::enable_if<
!std::is_same<invoke_result_t<F>, void>::value,
Try<invoke_result_t<F>>>::type
makeTryWithNoUnwrap(F&& f) { … }
template <typename F>
typename std::
enable_if<std::is_same<invoke_result_t<F>, void>::value, Try<void>>::type
makeTryWithNoUnwrap(F&& f) { … }
template <typename F>
typename std::
enable_if<!isTry<invoke_result_t<F>>::value, Try<invoke_result_t<F>>>::type
makeTryWith(F&& f) { … }
template <typename F>
typename std::enable_if<isTry<invoke_result_t<F>>::value, invoke_result_t<F>>::
type
makeTryWith(F&& f) { … }
template <typename T, typename... Args>
T* tryEmplace(Try<T>& t, Args&&... args) noexcept { … }
void tryEmplace(Try<void>& t) noexcept { … }
template <typename T, typename Func>
T* tryEmplaceWith(Try<T>& t, Func&& func) noexcept { … }
template <typename Func>
bool tryEmplaceWith(Try<void>& t, Func&& func) noexcept { … }
namespace try_detail {
template <typename Type>
struct RemoveTry;
RemoveTry<TupleType<folly::Try<Types>...>>;
template <std::size_t... Indices, typename Tuple>
auto unwrapTryTupleImpl(std::index_sequence<Indices...>, Tuple&& instance) { … }
}
template <typename Tuple>
auto unwrapTryTuple(Tuple&& instance) { … }
template <typename T>
void tryAssign(Try<T>& t, Try<T>&& other) noexcept { … }
extern template class Try<Unit>;
}