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

Remove redundant this-> in library specification #884

Merged
merged 4 commits into from Aug 15, 2016

Conversation

timsong-cpp
Copy link
Contributor

in [string::compare] and [any.modifiers].

Also fix a missing \tcode in [variant.assign] discovered on the way.

@@ -3617,7 +3617,7 @@
\effects
Equivalent to:
\begin{codeblock}
return basic_string_view<charT, traits>(this.data(), pos1, n1).compare(sv);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we ever say this-> elsewhere? Wouldn't we just say data()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other any::emplace, for one. A quick search shows a few dozen this->s in the library clauses.

Copy link
Member

Choose a reason for hiding this comment

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

Almost all of them appear to be very recent additions and redundant. I would prefer to remove all of these occurrences that are neither necessary ([filebuf.assign]/1's this-> is necessary since close is a member of a dependent base class) nor significantly improve clarity.

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, I'll prepare a commit removing them all instead.

What dependent base, though? close is a member of basic_filebuf, not basic_streambuf.

Copy link
Contributor

Choose a reason for hiding this comment

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

@timsong-cpp
Copy link
Contributor Author

timsong-cpp commented Aug 6, 2016

I left four this-> unchanged; two are in [bitset.members] (non-const operator[]), one in [unique.ptr.single.modifiers] (reset()), and one in [memory.resource.pool.ctor] (note in constructor's description).

@timsong-cpp timsong-cpp changed the title Fixes several this.meow()s Remove redundant this-> in library specification Aug 6, 2016
@jwakely jwakely merged commit e90dfda into cplusplus:master Aug 15, 2016
@timsong-cpp timsong-cpp deleted the this_fixes branch August 24, 2016 20:41
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

4 participants