-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathbad_any_cast.hpp
45 lines (35 loc) · 1.04 KB
/
bad_any_cast.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright Antony Polukhin, 2020-2024.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/any for Documentation.
#ifndef BOOST_ANYS_BAD_ANY_CAST_HPP_INCLUDED
#define BOOST_ANYS_BAD_ANY_CAST_HPP_INCLUDED
#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
#endif
#ifndef BOOST_NO_RTTI
#include <typeinfo>
#endif
#include <stdexcept>
namespace boost {
/// The exception thrown in the event of a failed boost::any_cast of
/// an boost::any, boost::anys::basic_any or boost::anys::unique_any value.
class BOOST_SYMBOL_VISIBLE bad_any_cast :
#ifndef BOOST_NO_RTTI
public std::bad_cast
#else
public std::exception
#endif
{
public:
const char * what() const BOOST_NOEXCEPT_OR_NOTHROW override
{
return "boost::bad_any_cast: "
"failed conversion using boost::any_cast";
}
};
} // namespace boost
#endif // #ifndef BOOST_ANYS_BAD_ANY_CAST_HPP_INCLUDED