xref: /freebsd-12.1/contrib/libc++/src/any.cpp (revision 4ba319b5)
19729cf09SDimitry Andric //===---------------------------- any.cpp ---------------------------------===//
29729cf09SDimitry Andric //
39729cf09SDimitry Andric //                     The LLVM Compiler Infrastructure
49729cf09SDimitry Andric //
59729cf09SDimitry Andric // This file is dual licensed under the MIT and the University of Illinois Open
69729cf09SDimitry Andric // Source Licenses. See LICENSE.TXT for details.
79729cf09SDimitry Andric //
89729cf09SDimitry Andric //===----------------------------------------------------------------------===//
99729cf09SDimitry Andric 
10aed8d94eSDimitry Andric #include "any"
119729cf09SDimitry Andric 
12aed8d94eSDimitry Andric namespace std {
what() const139729cf09SDimitry Andric const char* bad_any_cast::what() const _NOEXCEPT {
149729cf09SDimitry Andric     return "bad any cast";
159729cf09SDimitry Andric }
16aed8d94eSDimitry Andric }
179729cf09SDimitry Andric 
18*4ba319b5SDimitry Andric 
19*4ba319b5SDimitry Andric #include <experimental/__config>
20*4ba319b5SDimitry Andric 
21*4ba319b5SDimitry Andric //  Preserve std::experimental::any_bad_cast for ABI compatibility
22*4ba319b5SDimitry Andric //  Even though it no longer exists in a header file
23aed8d94eSDimitry Andric _LIBCPP_BEGIN_NAMESPACE_LFTS
24*4ba319b5SDimitry Andric 
25*4ba319b5SDimitry Andric class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
26*4ba319b5SDimitry Andric {
27*4ba319b5SDimitry Andric public:
28*4ba319b5SDimitry Andric     virtual const char* what() const _NOEXCEPT;
29*4ba319b5SDimitry Andric };
30*4ba319b5SDimitry Andric 
what() const31aed8d94eSDimitry Andric const char* bad_any_cast::what() const _NOEXCEPT {
32aed8d94eSDimitry Andric     return "bad any cast";
33aed8d94eSDimitry Andric }
34*4ba319b5SDimitry Andric 
359729cf09SDimitry Andric _LIBCPP_END_NAMESPACE_LFTS
36