1  
//
1  
//
2  
// Copyright (c) 2019 Vinnie Falco (vinnie dot falco at gmail dot com)
2  
// Copyright (c) 2019 Vinnie Falco (vinnie dot falco at gmail dot com)
3  
//
3  
//
4  
// Distributed under the Boost Software License, Version 1.0. (See accompanying
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)
5  
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6  
//
6  
//
7  
// Official repository: https://github.com/cppalliance/capy
7  
// Official repository: https://github.com/cppalliance/capy
8  
//
8  
//
9  

9  

10  
#include <boost/capy/detail/config.hpp>
10  
#include <boost/capy/detail/config.hpp>
11  
#include <boost/capy/detail/except.hpp>
11  
#include <boost/capy/detail/except.hpp>
12  
#include <system_error>
12  
#include <system_error>
13  
#include <stdexcept>
13  
#include <stdexcept>
14  
#include <typeinfo>
14  
#include <typeinfo>
15  

15  

16  
namespace boost {
16  
namespace boost {
17  
namespace capy {
17  
namespace capy {
18  
namespace detail {
18  
namespace detail {
19  

19  

20  
void
20  
void
21  
throw_bad_typeid()
21  
throw_bad_typeid()
22  
{
22  
{
23  
    throw std::bad_typeid();
23  
    throw std::bad_typeid();
24  
}
24  
}
25  

25  

26  
void
26  
void
27  
throw_bad_alloc()
27  
throw_bad_alloc()
28  
{
28  
{
29  
    throw std::bad_alloc();
29  
    throw std::bad_alloc();
30  
}
30  
}
31  

31  

32  
void
32  
void
33  
throw_invalid_argument()
33  
throw_invalid_argument()
34  
{
34  
{
35  
    throw std::invalid_argument(
35  
    throw std::invalid_argument(
36  
        "invalid argument");
36  
        "invalid argument");
37  
}
37  
}
38  

38  

39  
void
39  
void
40  
throw_invalid_argument(
40  
throw_invalid_argument(
41  
    char const* what)
41  
    char const* what)
42  
{
42  
{
43  
    throw std::invalid_argument(what);
43  
    throw std::invalid_argument(what);
44  
}
44  
}
45  

45  

46  
void
46  
void
47  
throw_length_error()
47  
throw_length_error()
48  
{
48  
{
49  
    throw std::length_error(
49  
    throw std::length_error(
50  
        "length error");
50  
        "length error");
51  
}
51  
}
52  

52  

53  
void
53  
void
54  
throw_length_error(
54  
throw_length_error(
55  
    char const* what)
55  
    char const* what)
56  
{
56  
{
57  
    throw std::length_error(what);
57  
    throw std::length_error(what);
58  
}
58  
}
59  

59  

60  
void
60  
void
61  
throw_logic_error()
61  
throw_logic_error()
62  
{
62  
{
63  
    throw std::logic_error(
63  
    throw std::logic_error(
64  
        "logic error");
64  
        "logic error");
65  
}
65  
}
66  

66  

67  
void
67  
void
68  
throw_out_of_range()
68  
throw_out_of_range()
69  
{
69  
{
70  
    throw std::out_of_range("out of range");
70  
    throw std::out_of_range("out of range");
71  
}
71  
}
72  

72  

73  
void
73  
void
74  
throw_runtime_error(
74  
throw_runtime_error(
75  
    char const* what)
75  
    char const* what)
76  
{
76  
{
77  
    throw std::runtime_error(what);
77  
    throw std::runtime_error(what);
78  
}
78  
}
79  

79  

80  
void
80  
void
81  
throw_system_error(
81  
throw_system_error(
82  
    std::error_code const& ec)
82  
    std::error_code const& ec)
83  
{
83  
{
84  
    throw std::system_error(ec);
84  
    throw std::system_error(ec);
85  
}
85  
}
86  

86  

87  
} // detail
87  
} // detail
88  
} // capy
88  
} // capy
89  
} // boost
89  
} // boost