1 #ifndef BOOST_METAPARSE_V1_CPP11_IMPL_REMOVE_TRAILING_NO_CHARS_HPP
2 #define BOOST_METAPARSE_V1_CPP11_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/v1/cpp11/string.hpp>
10 #include <boost/metaparse/v1/impl/no_char.hpp>
11 #include <boost/metaparse/v1/cpp11/impl/push_front_c.hpp>
22 struct remove_trailing_no_chars : S {};
24 // this code assumes that BOOST_NO_CHARs are at the end of the string
26 struct remove_trailing_no_chars<string<BOOST_NO_CHAR, Cs...>> :
30 template <char C, char... Cs>
31 struct remove_trailing_no_chars<string<C, Cs...>> :
32 push_front_c<typename remove_trailing_no_chars<string<Cs...>>::type,C>
37 * These specialisations are needed to avoid an internal compiler error
41 struct remove_trailing_no_chars<string<C>> : string<C> {};
44 struct remove_trailing_no_chars<string<BOOST_NO_CHAR>> : string<> {};
47 struct remove_trailing_no_chars<string<>> : string<> {};