Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[locale.cons] Ambiguous argument in Throws for locale+name+category constructor #5292

Closed
hubert-reinterpretcast opened this issue Feb 12, 2022 · 5 comments

Comments

@hubert-reinterpretcast
Copy link
Contributor

locale(const locale& other, const char* std_name, category);

has

Throws: runtime_error if the argument is not valid, or is null.

There being three arguments, the statement is rather problematic.

It looks like a copy/paste from

explicit locale(const char* std_name);

The conclusion seems to be that the statement should be changed to read:

Throws: runtime_error if std_name is not valid, or is null.

@hubert-reinterpretcast
Copy link
Contributor Author

@jwakely, fyi.

@jensmaurer
Copy link
Member

Is there any way that "category" can be invalid?

@hubert-reinterpretcast
Copy link
Contributor Author

hubert-reinterpretcast commented Feb 12, 2022 via email

@jensmaurer
Copy link
Member

jensmaurer commented Feb 12, 2022

Is the question whether the exception should also apply if thecategory value is not valid?

Yes, that's the question. If there is no obvious answer, this looks like LWG material.

@hubert-reinterpretcast
Copy link
Contributor Author

hubert-reinterpretcast commented Feb 12, 2022

... and there's implementation divergence! LWG issue opened: https://cplusplus.github.io/LWG/lwg-active.html#3673.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants