bad_visit.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 <exception>
  15. namespace boost {
  16. //////////////////////////////////////////////////////////////////////////
  17. // class bad_visit
  18. //
  19. // Exception thrown when a visitation attempt via apply_visitor fails due
  20. // to invalid visited subtype or contents.
  21. //
  22. struct BOOST_SYMBOL_VISIBLE bad_visit
  23. : std::exception
  24. {
  25. public: // std::exception interface
  26. virtual const char * what() const BOOST_NOEXCEPT_OR_NOTHROW
  27. {
  28. return "boost::bad_visit: "
  29. "failed visitation using boost::apply_visitor";
  30. }
  31. };
  32. } // namespace boost
  33. #endif // BOOST_VARIANT_BAD_VISIT_HPP