Silicium
Classes | Namespaces | Functions
error_or.hpp File Reference
#include <silicium/optional.hpp>
#include <boost/system/system_error.hpp>
#include <boost/throw_exception.hpp>
#include <boost/functional/hash.hpp>
#include <boost/mpl/bool.hpp>
#include <system_error>
#include <array>

Go to the source code of this file.

Classes

struct  Si::detail::category< ErrorCode >
 
struct  Si::error_or< Value, Error >
 
struct  Si::is_error_or< T >
 
struct  Si::is_error_or< error_or< Value, Error > >
 
struct  std::hash< Si::error_or< Value, Error > >
 

Namespaces

 Si
 
 Si::detail
 
 std
 

Functions

SILICIUM_NORETURN void Si::throw_error (boost::system::error_code error)
 
SILICIUM_NORETURN void Si::throw_error (std::error_code error)
 
template<class To , class From >
From && Si::detail::convert_if_necessary (From &&from, std::true_type)
 
template<class To , class From >
To Si::detail::convert_if_necessary (From &&from, std::false_type)
 
 Si::BOOST_STATIC_ASSERT (is_handle< error_or< nothing >>::value)
 
 Si::BOOST_STATIC_ASSERT (is_handle< error_or< int >>::value)
 
 Si::BOOST_STATIC_ASSERT (is_handle< error_or< std::unique_ptr< int >>>::value)
 
template<class Value , class Error , class Anything >
bool Si::operator== (error_or< Value, Error > const &left, Anything const &right)
 
template<class Anything , class Value , class Error , class = typename std::enable_if<!is_error_or<Anything>::value, void>::type>
bool Si::operator== (Anything const &left, error_or< Value, Error > const &right)
 
template<class Anything , class Value , class Error >
bool Si::operator!= (Anything const &left, error_or< Value, Error > const &right)
 
template<class Anything , class Value , class Error >
bool Si::operator!= (error_or< Value, Error > const &left, Anything const &right)
 
template<class Value , class Error >
bool Si::operator< (error_or< Value, Error > const &left, error_or< Value, Error > const &right)
 
template<class Value , class Error >
std::size_t Si::hash_value (error_or< Value, Error > const &value)
 
template<class Value , class Error >
std::ostream & Si::operator<< (std::ostream &out, error_or< Value, Error > const &value)
 
template<class T >
std::remove_reference< T >::type && Si::detail::move_if (boost::mpl::true_, T &&ref)
 
template<class T >
T & Si::detail::move_if (boost::mpl::false_, T &&ref)
 
template<class ErrorOr , class OnValue , class CleanErrorOr = typename std::decay<ErrorOr>::type, class = typename std::enable_if<is_error_or<CleanErrorOr>::value, void>::type>
auto Si::map (ErrorOr &&maybe, OnValue &&on_value) -> error_or< decltype(std::forward< OnValue >(on_value)(std::forward< ErrorOr >(maybe).get()))>
 
template<class Value , class Error >
Value Si::get (error_or< Value, Error > &&value)