define_error.hpp 621 B

12345678910111213141516171819202122232425
  1. #ifndef BOOST_METAPARSE_V1_DEFINE_ERROR_HPP
  2. #define BOOST_METAPARSE_V1_DEFINE_ERROR_HPP
  3. // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #include <string>
  8. #ifdef BOOST_METAPARSE_V1_DEFINE_ERROR
  9. # error BOOST_METAPARSE_V1_DEFINE_ERROR already defined
  10. #endif
  11. #define BOOST_METAPARSE_V1_DEFINE_ERROR(name, msg) \
  12. struct name \
  13. { \
  14. typedef name type; \
  15. static std::string get_value() \
  16. { \
  17. return msg; \
  18. } \
  19. }
  20. #endif