result.hpp
#include "error.hpp"
namespace system_error2
{
template <class T>inline constexpr std::in_place_type_t<T>in_place_type{};
template <class T>
struct is_result;
template <class T>
struct is_result<result<T>;
class bad_result_access;
template <class T>
class result;
template <class T, class U, typename = decltype(std::declval<T>()==std::declval<U>())>
constexpr bool operator==(result<T> const& a, result<U> const& b) noexcept;
template <class T, class U, typename = decltype(std::declval<T>()!=std::declval<U>())>
constexpr bool operator!=(result<T> const& a, result<U> const& b) noexcept;
}
system_error2::is_result
template <class T>
struct is_result
{
};
A trait for detecting result types
system_error2::bad_result_access
class bad_result_access
: public std::exception
{
public:
bad_result_access() = default;
virtual char const* what() const noexcept;
};
Exception type representing the failure to retrieve an error.
system_error2::bad_result_access::what
virtual char const* what() const noexcept;
Return an explanatory string
system_error2::result
template <class T>
class result
{
};
(error while parsing comment text: unkown command \class)
system_error2::operator==
template <class T, class U, typename = decltype(std::declval<T>()==std::declval<U>())>
constexpr bool operator==(result<T> const& a, result<U> const& b) noexcept;
True if the two results compare equal.
system_error2::operator!=
template <class T, class U, typename = decltype(std::declval<T>()!=std::declval<U>())>
constexpr bool operator!=(result<T> const& a, result<U> const& b) noexcept;
True if the two results compare unequal.