at_c.hpp 809 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef BOOST_METAPARSE_V1_CPP11_IMPL_AT_C_HPP
  2. #define BOOST_METAPARSE_V1_CPP11_IMPL_AT_C_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 <boost/metaparse/v1/cpp11/fwd/string.hpp>
  8. #include <boost/mpl/char.hpp>
  9. namespace boost
  10. {
  11. namespace metaparse
  12. {
  13. namespace v1
  14. {
  15. namespace impl
  16. {
  17. template <class S, int N>
  18. struct at_c;
  19. template <char C, char... Cs, int N>
  20. struct at_c<string<C, Cs...>, N> : at_c<string<Cs...>, N - 1> {};
  21. template <char C, char... Cs>
  22. struct at_c<string<C, Cs...>, 0> : boost::mpl::char_<C> {};
  23. }
  24. }
  25. }
  26. }
  27. #endif