1 //
2 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/boostorg/json
8 //
9 
10 #ifndef BOOST_JSON_SYSTEM_ERROR_HPP
11 #define BOOST_JSON_SYSTEM_ERROR_HPP
12 
13 #include <boost/json/detail/config.hpp>
14 #ifndef BOOST_JSON_STANDALONE
15 # include <boost/system/error_code.hpp>
16 # include <boost/system/system_error.hpp>
17 #else
18 # include <system_error>
19 #endif
20 
21 BOOST_JSON_NS_BEGIN
22 
23 #ifndef BOOST_JSON_STANDALONE
24 
25 /// The type of error code used by the library.
26 using error_code = boost::system::error_code;
27 
28 /// The type of error category used by the library.
29 using error_category = boost::system::error_category;
30 
31 /// The type of error condition used by the library.
32 using error_condition = boost::system::error_condition;
33 
34 /// The type of system error thrown by the library.
35 using system_error = boost::system::system_error;
36 
37 #ifdef BOOST_JSON_DOCS
38 /// Returns the generic error category used by the library.
39 error_category const&
40 generic_category();
41 #else
42 using boost::system::generic_category;
43 #endif
44 
45 #else
46 
47 using error_code = std::error_code;
48 using error_category = std::error_category;
49 using error_condition = std::error_condition;
50 using system_error = std::system_error;
51 using std::generic_category;
52 
53 #endif
54 
55 BOOST_JSON_NS_END
56 
57 #endif
58