1 #ifndef SILICIUM_ERROR_CODE_HPP
2 #define SILICIUM_ERROR_CODE_HPP
5 #include <boost/system/error_code.hpp>
6 #include <boost/throw_exception.hpp>
7 #include <boost/static_assert.hpp>
11 template <
class UnderlyingErrorCode = boost::system::error_code,
class UnderlyingCategory = boost::system::error_category>
19 template <
int Value, UnderlyingCategory const &(*Category)()>
22 static UnderlyingErrorCode
const instance(Value, Category());
32 return UnderlyingErrorCode();
40 int value() const BOOST_NOEXCEPT
45 UnderlyingCategory
const &
category() const BOOST_NOEXCEPT
52 UnderlyingErrorCode
const *underlying;
54 explicit error_code(UnderlyingErrorCode
const &underlying) BOOST_NOEXCEPT
55 : underlying(&underlying)
62 template <
class UnderlyingErrorCode,
class UnderlyingCategory>
68 template <
class UnderlyingErrorCode,
class UnderlyingCategory>
78 template <
class UnderlyingErrorCode,
class UnderlyingCategory>
81 return std::hash<error_code<UnderlyingErrorCode, UnderlyingCategory>>()(value);
84 template <
class UnderlyingErrorCode,
class UnderlyingCategory>
85 std::ostream &operator << (std::ostream &out, error_code<UnderlyingErrorCode, UnderlyingCategory>
const &value)
87 return out << value.to_underlying();
93 template <
class UnderlyingErrorCode,
class UnderlyingCategory>
94 struct hash<
Si::error_code<UnderlyingErrorCode, UnderlyingCategory>>
BOOST_STATIC_ASSERT(Si::is_handle< absolute_path >::value)
SILICIUM_NORETURN void throw_error(error_code< UnderlyingErrorCode, UnderlyingCategory > error)
Definition: error_code.hpp:69
int value() const BOOST_NOEXCEPT
Definition: error_code.hpp:40
error_code() BOOST_NOEXCEPT
Definition: error_code.hpp:14
Definition: absolute_path.hpp:352
Definition: absolute_path.hpp:19
SILICIUM_USE_RESULT bool operator==(absolute_path const &left, ComparableToPath const &right)
Definition: absolute_path.hpp:169
Definition: error_code.hpp:12
static error_code create()
Definition: error_code.hpp:20
std::size_t operator()(Si::error_code< UnderlyingErrorCode, UnderlyingCategory > const &value) const
Definition: error_code.hpp:96
std::size_t hash_value(error_code< UnderlyingErrorCode, UnderlyingCategory > const &value)
Definition: error_code.hpp:79
void clear() BOOST_NOEXCEPT
Definition: error_code.hpp:35
UnderlyingCategory const & category() const BOOST_NOEXCEPT
Definition: error_code.hpp:45
#define SILICIUM_NORETURN
Definition: config.hpp:63
UnderlyingErrorCode to_underlying() const
Definition: error_code.hpp:26
SILICIUM_USE_RESULT std::size_t hash_value(absolute_path const &value)
Definition: absolute_path.hpp:220