[#one_char_except]
[section one_char_except]

[h1 Synopsis]

  template <class... Cs>
  struct one_char_except;

This is a [link parser parser].

[table Arguments
  [[Name]       [Type]]
  [[`Cs`]       [[link boxed_value boxed] character values]]
]

[h1 Description]

`one_char_except` accepts one character except any of `Cs`. When the input is
empty or begins with one of the non-accepted characters, `one_char_except`
rejects the input. Otherwise it accepts the input and the result of parsing is
the character value.

On compilers, which are not C++11-compliant, the maximum number of characters
this class can have is the value the macro
`BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE` expands to. Its default value is
10.

[h1 Header]

  #include <boost/metaparse/one_char_except.hpp>

[h1 Expression semantics]

For any `c1`, ..., `cn` boxed characters the following are equivalent

  one_char_except<c1, ..., cn>
  
  one_char_except_c<c1::type::value, ..., cn::type::value>

[h1 Example]

  #include <boost/metaparse/one_char_except.hpp>
  #include <boost/metaparse/lit_c.hpp>
  #include <boost/metaparse/middle_of.hpp>
  #include <boost/metaparse/repeated.hpp>
  #include <boost/metaparse/start.hpp>
  #include <boost/metaparse/string.hpp>
  #include <boost/metaparse/get_result.hpp>
  
  #include <boost/mpl/vector.hpp>
  #include <boost/mpl/char.hpp>
  #include <boost/mpl/equal.hpp>
  
  #include <type_traits>
  
  using namespace boost::metaparse;
  
  using string_literal_parser =
    middle_of<
      lit_c<'"'>,
      repeated<one_char_except<std::integral_constant<char, '"'>>>,
      lit_c<'"'>
    >;
  
  static_assert(
    boost::mpl::equal<
      boost::mpl::vector<
        boost::mpl::char_<'h'>,
        boost::mpl::char_<'e'>,
        boost::mpl::char_<'l'>,
        boost::mpl::char_<'l'>,
        boost::mpl::char_<'o'>
      >,
      get_result<
        string_literal_parser::apply<BOOST_METAPARSE_STRING("\"hello\""), start>
      >::type
    >::type::value,
    "it should return the content of the string literal"
  );

[endsect]

