tzlaine / parser

A C++ parser combinator library.
Boost Software License 1.0
81 stars 12 forks source link

Docs: is str_3 character range example correct? #140

Closed LegalizeAdulthood closed 7 months ago

LegalizeAdulthood commented 7 months ago

On the page The parse() API, the code snippet in the second code block is given as:

char const * str_3 = "str";
auto result_3 = bp::parse(str_3 | boost::parser::as_utf16, p, bp::ws);

This is saying to parse the range of char characters as UTF-16? Should this be char16_t?

tzlaine commented 7 months ago

No, the example is correct. str_3 | boost::parser::as_utf16 is a transcoding view that produces char16_ts.