C++ Logo

std-discussion

Advanced search

Re: Problem of the type requirement of the regex library

From: Edward Diener <eldlistmailingz_at_[hidden]>
Date: Thu, 26 Dec 2019 14:04:04 -0500
On 12/25/2019 4:18 PM, Thiago Macieira via Std-Discussion wrote:
> On Tuesday, 24 December 2019 04:47:36 -03 Xie He via Std-Discussion wrote:
>> In 30.1 [re.general] Paragraph 2, change "char-like template
>> arguments" to "template arguments that are integral types that encode
>> Unicode code point values, with char_traits<the type> having its
>> two-parameter assign, eq and lt functions provide identical results as
>> the =, ==, < operators, for all valid code points the type supports".
>
> I would go MUCH further: the regular expression library should be
> restricted
> to char8_t, char16_t and char32_t. For compatibility reasons, char is
> interpreted as char8_t. No other encodings or types.
>
> Users who roll out their strings based on a different character type are
> welcome to convert their strings to one of the three above before
> using the
> regular expression library.

Template libraries should determine the types they can work with based
on type requirements, not an arbitrary hard-coded set of types.
Determination based on type requirements gives the library a flexibility
which a hard-coded set of types does not have.

Received on 2019-12-26 13:06:34