C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: Difference in default argument re.regex vs. re.regex.assign
From: Daniel Krügler (daniel.kruegler_at_[hidden])
Date: 2019-09-14 08:08:53


Am Do., 5. Sept. 2019 um 21:49 Uhr schrieb Mark de Wever via
Std-Discussion <std-discussion_at_[hidden]>:
>
> I've been looking at the regex documentation in N4830 and see an
> inconsistency:
>
> [re.regex]
> basic_regex& assign(const charT* p, size_t len, flag_type f);
>
> [re.regex.assign]
> basic_regex& assign(const charT* ptr, size_t len, flag_type f =
> regex_constants::ECMAScript);
>
> Is the difference in the default argument between to two places a
> defect? I assume it is and I should file a DR. IMO it should be
> defaulted to regex_constants::ECMAScript at both places. At least one
> implementation (libc++) implements the assignment without a default
> argument.
>
> Is this a real defect? Should it be a DR or an editorial issue?

This is clearly a non-editorial change and I suggest to submit an LWG
issue for it.

>
> Kind regards,
> Mark de Wever
>
> PS: I consider the difference between p and ptr and an editorial issue
> and will create a pull request at GitHub.

Yes, this is definitively an editorial change.

Thanks,

- Daniel


STD-DISCUSSION list run by herb.sutter at gmail.com

Older Archives on Google Groups