bad_visit.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //-----------------------------------------------------------------------------
  2. // boost variant/bad_visit.hpp header file
  3. // See http://www.boost.org for updates, documentation, and revision history.
  4. //-----------------------------------------------------------------------------
  5. //
  6. // Copyright (c) 2002-2003
  7. // Eric Friedman
  8. //
  9. // Distributed under the Boost Software License, Version 1.0. (See
  10. // accompanying file LICENSE_1_0.txt or copy at
  11. // http://www.boost.org/LICENSE_1_0.txt)
  12. #ifndef BOOST_VARIANT_BAD_VISIT_HPP
  13. #define BOOST_VARIANT_BAD_VISIT_HPP
  14. #include <boost/config.hpp>
  15. #include <exception>
  16. namespace boost {
  17. //////////////////////////////////////////////////////////////////////////
  18. // class bad_visit
  19. //
  20. // Exception thrown when a visitation attempt via apply_visitor fails due
  21. // to invalid visited subtype or contents.
  22. //
  23. struct BOOST_SYMBOL_VISIBLE bad_visit
  24. : std::exception
  25. {
  26. public: // std::exception interface
  27. const char * what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE
  28. {
  29. return "boost::bad_visit: "
  30. "failed visitation using boost::apply_visitor";
  31. }
  32. };
  33. } // namespace boost
  34. #endif // BOOST_VARIANT_BAD_VISIT_HPP