unless_error.hpp 679 B

1234567891011121314151617181920212223242526272829
  1. #ifndef BOOST_METAPARSE_V1_UTIL_UNLESS_ERROR_HPP
  2. #define BOOST_METAPARSE_V1_UTIL_UNLESS_ERROR_HPP
  3. // Copyright Abel Sinkovics (abel@sinkovics.hu) 2011.
  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 <boost/metaparse/v1/is_error.hpp>
  8. #include <boost/mpl/equal_to.hpp>
  9. #include <boost/mpl/eval_if.hpp>
  10. namespace boost
  11. {
  12. namespace metaparse
  13. {
  14. namespace v1
  15. {
  16. template <class T, class NotErrorCase>
  17. struct unless_error :
  18. boost::mpl::eval_if<typename is_error<T>::type, T, NotErrorCase>
  19. {};
  20. }
  21. }
  22. }
  23. #endif