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

Use value_type instead of charT in the string_view declarations. #1411

Closed
wants to merge 1 commit into from
Closed

Conversation

mclow
Copy link
Contributor

@mclow mclow commented Jan 30, 2017

No description provided.

constexpr basic_string_view(const charT* str);
constexpr basic_string_view(const charT* str, size_type len);
constexpr basic_string_view(const value_type* str);
constexpr basic_string_view(const value_type* str, size_type len);
Copy link
Member

@jwakely jwakely Jan 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change means a deduction guide would be required to deduce the template args when using these constructors. That makes it a normative change, and possibly against LEWG's guidance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then. Let's not do that. :-). What I really want is the typedefs at the top. If we can agree that those are OK (and editorial), then I'll make a new PR with just those.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as there are no constructors taking the pointer or reference types I think that is editorial.

@jensmaurer
Copy link
Member

Is there any particular reason to prefer one or the other style? Or is it just that template parameters are uglified by the implementation, so not having them appear frequently is a good idea?

@mclow
Copy link
Contributor Author

mclow commented Jan 31, 2017

It's both an uglified thing, and a consistency thing. basic_string has a reference type of value_type &, and basic_string_view has a reference type of charT& (ok, const). Unless there's a good reason for them to be different, I'd rather they be the same.

@mclow
Copy link
Contributor Author

mclow commented Jan 31, 2017

I've created #1416 with just the typedef changes. Closing this one.

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

Successfully merging this pull request may close these issues.

None yet

3 participants