middle_of.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef BOOST_METAPARSE_V1_KEEP_MIDDLE_HPP
  2. #define BOOST_METAPARSE_V1_KEEP_MIDDLE_HPP
  3. // Copyright Abel Sinkovics ([email protected]) 2009 - 2010.
  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/nth_of.hpp>
  8. #include <boost/metaparse/v1/transform_error_message.hpp>
  9. #include <boost/metaparse/v1/get_col.hpp>
  10. #include <boost/metaparse/v1/get_line.hpp>
  11. #include <boost/metaparse/v1/error/unpaired.hpp>
  12. namespace boost
  13. {
  14. namespace metaparse
  15. {
  16. namespace v1
  17. {
  18. template <class P1, class P2, class P3>
  19. struct middle_of
  20. {
  21. typedef middle_of type;
  22. template <class S, class Pos>
  23. struct apply :
  24. nth_of_c<
  25. 1,
  26. P1,
  27. P2,
  28. transform_error_message<
  29. P3,
  30. error::unpaired<
  31. get_line<Pos>::type::value,
  32. get_col<Pos>::type::value
  33. >
  34. >
  35. >::template apply<S, Pos>
  36. {};
  37. };
  38. }
  39. }
  40. }
  41. #endif