1 #ifndef BOOST_METAPARSE_V1_IMPL_REMOVE_TRAILING_NO_CHARS_HPP
2 #define BOOST_METAPARSE_V1_IMPL_REMOVE_TRAILING_NO_CHARS_HPP
4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #include <boost/metaparse/config.hpp>
10 #include <boost/metaparse/v1/string.hpp>
11 #include <boost/metaparse/v1/impl/push_front_c.hpp>
22 struct remove_trailing_no_chars : S {};
24 #ifdef BOOST_METAPARSE_VARIADIC_STRING
25 // this code assumes that BOOST_NO_CHARs are at the end of the string
27 struct remove_trailing_no_chars<string<BOOST_NO_CHAR, Cs...>> :
31 template <char C, char... Cs>
32 struct remove_trailing_no_chars<string<C, Cs...>> :
33 push_front_c<typename remove_trailing_no_chars<string<Cs...>>::type,C>
38 * These specialisations are needed to avoid an internal compiler error
42 struct remove_trailing_no_chars<string<C>> : string<C> {};
45 struct remove_trailing_no_chars<string<BOOST_NO_CHAR>> : string<> {};
48 struct remove_trailing_no_chars<string<>> : string<> {};