exception.hpp 848 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #ifndef BOOST_TYPE_ERASURE_EXCEPTION_HPP_INCLUDED
  11. #define BOOST_TYPE_ERASURE_EXCEPTION_HPP_INCLUDED
  12. #include <stdexcept>
  13. #include <typeinfo>
  14. #include <string>
  15. namespace boost {
  16. namespace type_erasure {
  17. /**
  18. * Exception thrown when the arguments to a primitive concept
  19. * are incorrect.
  20. *
  21. * \see \call, \require_match
  22. */
  23. class bad_function_call : public ::std::invalid_argument
  24. {
  25. public:
  26. bad_function_call() : ::std::invalid_argument("bad_function_call") {}
  27. };
  28. /**
  29. * Exception thrown when an \any_cast to a reference or value fails.
  30. */
  31. class bad_any_cast : public std::bad_cast {};
  32. }
  33. }
  34. #endif