1 // Boost.TypeErasure library 2 // 3 // Copyright 2011-2012 Steven Watanabe 4 // 5 // Distributed under the Boost Software License Version 1.0. (See 6 // accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt) 8 // 9 // $Id$ 10 11 #ifndef BOOST_TYPE_ERASURE_EXCEPTION_HPP_INCLUDED 12 #define BOOST_TYPE_ERASURE_EXCEPTION_HPP_INCLUDED 13 14 #include <stdexcept> 15 #include <typeinfo> 16 #include <string> 17 18 namespace boost { 19 namespace type_erasure { 20 21 /** 22 * Exception thrown when the arguments to a primitive concept 23 * are incorrect. 24 * 25 * \see \call, \require_match 26 */ 27 class bad_function_call : public ::std::invalid_argument 28 { 29 public: bad_function_call()30 bad_function_call() : ::std::invalid_argument("bad_function_call") {} 31 }; 32 33 /** 34 * Exception thrown when an \any_cast to a reference or value fails. 35 */ 36 class bad_any_cast : public std::bad_cast {}; 37 38 } 39 } 40 41 #endif 42