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
[18-30] Replace typedefs with alias #704
[18-30] Replace typedefs with alias #704
Conversation
This pull request addresses #581 |
Note that I can break this down into a dozen distinct file-specific pull requests if that is preferred; the suggestion in the issue is that a single pull large pull request was the way to go though. The are no changes to clause 19 and 25, and I deliberately stayed out of clause 29 as that clause is deliberately written using C idioms. |
Thanks. I think a single pull request makes more sense. I'll go through this asap and merge. |
using const_pointer = typename allocator_traits<Allocator>::const_pointer; | ||
using reference = value_type&; | ||
using const_reference = const value_type&; | ||
using size_type = @\impdefnc@; // see \ref{container.requirements} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get rid of the non-correcting forms here (i.e. use just \impdef
) now that the alignment at the ragged edge doesn't matter anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, you are saying replace '\impdefnc' with '\impdef'?
If so, is that a general rule, or applies only to header synopses and other code snippets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. "nc" stands for "no (italic) correction", which affects the column alignment. You ought to be able to see the difference (look for how characters (fail to) align on the grid without the correction). But now that the relevant text is at the end of the line, there's nothing left to be aligned, and we don't need to control the italic correction.
That was one of the benefits of changing typedef
to using
that @zygoloid pointed out in his first email about this subject a few months ago if I recall correctly.
912b5f2
to
0f6d327
Compare
Final (I hope!) patch adds the updates for [utility]. I will now wait for this pull request to land before once-again rebasing #683 |
Can you squash the few fixup commits you have into the respective main commits? |
Squash them all as a single commit, or just the last couple? |
Just the ones that are fixups - 0f6d327 and 8933e27. (You may wish to first rebase those commits to the front, then reset (= uncommit the changes), then recommit them as small per-file commits, and then "fixup"-rebase those onto their main commits. |
typo in |
8933e27
to
9e71133
Compare
Fixed the typo (thanks lv-zheng) and force-pushed a single squash-commit of the whole branch. No other changes. |
I want to go ahead with this, but not until after Oulu. Sorry if this requires extra rebasing as a result! |
@zygoloid: Last standard, you didn't want to make major formatting changes after the CD had gone out (e.g. I remember fixing up the vertical whitespace problems with the old heading styles to be one such change). Will there still be room for changes like this after Oulu? Will you only create the CD after the meeting? |
If we plan to land this after Oulu, is there anything I can do to land it /before/ papers start landing from the meeting. It will be much easier to update the standard for incoming papers with this in place (and editorial discretion when applying updates) than taking another pass to totally redo the work, at an undetermined time after all Oulu papers have landed again. I will try to rebase and get another clean version up tonight, regardless. |
If we're going to land this before we land the Oulu motions, we may as well do so now. I think you're right, handling the merge as Oulu motions land is not going to be very difficult. (Sorry for not merging this sooner, I'd missed that the pre-Oulu mailing deadline was 2pm not end-of-day, and was putting together the new working draft in a bit of a rush.) |
using reference = typename Container::reference; | ||
using const_reference = typename Container::const_reference; | ||
using size_type = typename Container::size_type; | ||
using container_type = Container; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove the whitespace before Container
here. Now that we're not aligning anything else after the =
, this looks a bit odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like my 2-dimensional code :) But defer to the actual project editor on style choice - will update this tonight.
9e71133
to
50e43e5
Compare
Corrected Richard's issues above, and deployed the \grammarterm{typedef-name}{s} in several other places. Tried to avoid reformatting around long lines, but at least one paragraph was re-wrapped. Rebased, squashed, and --force pushed again. |
using char_type = charT; | ||
using traits_type = traits; | ||
using streambuf_type = basic_streambuf<charT,traits>; | ||
using ostream_type = basic_ostream<charT,traits>; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please align this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased again (just to be safe) and aligned the line highlighted above - should land cleanly.
This set of changes replace (almost) all use of 'typedef' in the library with a type alias instead: typedef Original NewName; -> using NewName = Original; Attention was paid to retaining table-like formatting where present, which is worth reviewing in case I made idiosyncratic choices. Clause 29 [atomic] was specifically ignored, as there is a desire for the contained code to look as close to a C compatible header as possible.
50e43e5
to
f2d8a8e
Compare
Replaced typedef with using as per: [18-30] Replace typedefs with alias-declarations (#704)
Replaced typedef with using as per: [18-30] Replace typedefs with alias-declarations (#704)
Replaced typedef with using as per: [18-30] Replace typedefs with alias-declarations (#704)
Replaced typedef with using as per: [18-30] Replace typedefs with alias-declarations (#704)
Replaced typedef with using as per: [18-30] Replace typedefs with alias-declarations (#704)
Replaced typedef with using as per: [18-30] Replace typedefs with alias-declarations (#704)
This set of changes replace (almost) all use of 'typedef' in the library with a type alias instead: typedef Original NewName; -> using NewName = Original; Attention was paid to retaining table-like formatting where present, which is worth reviewing in case I made idiosyncratic choices. Clause 29 [atomic] was specifically ignored, as there is a desire for the contained code to look as close to a C compatible header as possible.
This set of changes replace (almost) all use of 'typedef' in the library with a type alias instead:
typedef Original NewName; -> using NewName = Original;
Attention was paid to retaining table-like formatting where present, which is worth reviewing in case I made idiosyncratic choices.
Clause 20 has NOT been applied, as that clause is churning a bit at the moment, and I don't want a conflict there to hold up a this review. The most likely conflict is my own pull request:
#683
I will happily rebase and complete the work once that branch lands (or is deferred again until this branch completes)
A second set of changes that should follow are to update the text that refers to typedefs to perhaps use a term more consistent with the type alias syntax applied here - but I defer to the project editors to suggest such phrasing.