]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/json/detail/impl/except.ipp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / json / detail / impl / except.ipp
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_DETAIL_IMPL_EXCEPT_IPP
11 #define BOOST_JSON_DETAIL_IMPL_EXCEPT_IPP
12
13 #include <boost/json/detail/except.hpp>
14 #include <boost/version.hpp>
15 #include <boost/throw_exception.hpp>
16 #include <stdexcept>
17
18 BOOST_JSON_NS_BEGIN
19
20 namespace detail {
21
22 void
23 throw_bad_alloc(
24 source_location const& loc)
25 {
26 throw_exception(
27 std::bad_alloc(),
28 loc);
29 }
30
31 void
32 throw_length_error(
33 char const* what,
34 source_location const& loc)
35 {
36 throw_exception(
37 std::length_error(what),
38 loc);
39 }
40
41 void
42 throw_invalid_argument(
43 char const* what,
44 source_location const& loc)
45 {
46 throw_exception(
47 std::invalid_argument(what),
48 loc);
49 }
50
51 void
52 throw_out_of_range(
53 source_location const& loc)
54 {
55 throw_exception(
56 std::out_of_range(
57 "out of range"),
58 loc);
59 }
60
61 void
62 throw_system_error(
63 error_code const& ec,
64 source_location const& loc)
65 {
66 throw_exception(
67 system_error(ec),
68 loc);
69 }
70
71 } // detail
72 BOOST_JSON_NS_END
73
74 #endif