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

LWG2754 The in_place constructors and emplace functions added by P0032R3 don't require CopyConstructible #1072

Merged

Conversation

jwakely
Copy link
Member

@jwakely jwakely commented Nov 18, 2016

Also includes the changes to [ans.cons] p9 from P0504R0 (LWG Motion 19)
which modify the same paragraph.

if \tcode{decay_t<ValueType>} is the same type as \tcode{any} or
if \tcode{ValueType} is a specialization of \tcode{in_place_type_t}.
This constructor shall not participate in overload resolution unless
\tcode{T} is the same type as \tcode{any},
Copy link
Contributor

Choose a reason for hiding this comment

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

is not the same??

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, thanks.

\end{itemdecl}

\begin{itemdescr}
\pnum
Let \tcode{T} be equal to \tcode{decay_t<ValueType>}.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would leave out "equal to" - it's not in the paper, it's inconsistent with other "Let"s, and it adds nothing.

Copy link
Member Author

@jwakely jwakely Nov 18, 2016

Choose a reason for hiding this comment

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

I added it in to be consistent with what was already there, e.g.

Let \tcode{T} be equal to \tcode{decay_t<ValueType>}.
(which is, at the time of writing, current master)

I dislike "equal to" for a typedef though, so I'll change it. I quite like "shall denote" that we use elsewhere, but will just go with "Let T be decay_t<ValueType>"

Copy link
Member Author

Choose a reason for hiding this comment

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

And it is in LWG 2754, for better or worse.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed and force pushed.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's NOT in 2754 - you must be looking at the superceded versions. See http://wg21.cmeerw.net/lwg/issue2754 (or skip past the superceded versions in http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0165r3.html).

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, you're right, I was looking at the superseded version. Although confusingly, the final version says "Let T be decay_t<ValueType>." even for the existing text that isn't changed (which is wrong). Bah. Anyway, I changed it.

\remarks
This constructor shall not participate in overload resolution unless
\tcode{is_copy_constructible_v<T>} is \tcode{true}
and \tcode{is_constructible_v<T, Args...>} is \tcode{true}.
Copy link
Contributor

@burblebee burblebee Nov 18, 2016

Choose a reason for hiding this comment

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

fyi, folks usually put the conjunction ("and" in this case) at the end of the previous line. not that you need to change it here, but I try to keep the spec coding style consistent (I'm sure you've noticed we have a long way to go there!)

On second thought, can you go ahead and make this change anyway? (there are several occurrences in this patch) since this will be rebased anyway, might as well try to be consistent from the start :)

I.e. do:
bla bla and
bla bla

Copy link
Member Author

Choose a reason for hiding this comment

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

FWIW I think that's the wrong choice, because if we have an Oxford comma then it seems natural to put the line break after the comma, and start the next line with the conjunction.

It also involves more editing for cases like:

case one,
case two,
case three, and
case four.

If you want to add a new case between three and four you have to edit an existing line, not just insert a new one:

case one,
case two,
case three, <DEL>and<DEL>
<INS>case three-point-five, and</INS>
case four.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed and force pushed.

Copy link
Contributor

Choose a reason for hiding this comment

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

You make a good point. I was simply following existing style - I will switch to doing things your way from now on, assuming others agree. Any one else have a preference?

Copy link
Contributor

Choose a reason for hiding this comment

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

so you did change things after all... what do we want to stick with as a group? When reading the Latex, I like the conjunction the previous line. I like the way it lines up :)

\end{itemdecl}

\begin{itemdescr}
\pnum
Let \tcode{T} be equal to \tcode{decay_t<ValueType>}.
Copy link
Contributor

Choose a reason for hiding this comment

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

same with "equal to" here

void emplace(Args&&... args);
\end{itemdecl}

\begin{itemdescr}
\pnum
\requires \tcode{is_constructible_v<T, Args...>} is \tcode{true}.
Let \tcode{T} be equal to \tcode{decay_t<ValueType>}.
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto for "equal to"

void emplace(initializer_list<U> il, Args&&... args);
\end{itemdecl}

\begin{itemdescr}
\pnum
Let \tcode{T} be equal to \tcode{decay_t<ValueType>}.
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto for "equal to"

@jwakely jwakely force-pushed the motions-2016-11-lwg-11 branch 2 times, most recently from e5153d0 to ec4e433 Compare November 18, 2016 23:26
…2R3 don't require CopyConstructible

Also includes the changes to [ans.cons] p9 from P0504R0 (LWG Motion 19)
which modify the same paragraph.
@burblebee
Copy link
Contributor

This is ready to go now right? Can you merge it into the motions branch? Or maybe I should ask: if I clicked "squash and merge", would it go to the motions branch or master?

@burblebee burblebee closed this Nov 19, 2016
@burblebee burblebee reopened this Nov 19, 2016
@burblebee
Copy link
Contributor

Hmm - probably shouldn't have closed until you committed right?

@burblebee
Copy link
Contributor

I see - you can tell the base from the line at the top:

"wants to merge 1 commit into cplusplus:motions-2016-11-lwg-11 from jwakely:motions-2016-11-lwg-11"

So this will go to the motions branch. Great - will merge then...

@burblebee burblebee merged commit e55bde8 into cplusplus:motions-2016-11-lwg-11 Nov 19, 2016
@jwakely
Copy link
Member Author

jwakely commented Nov 19, 2016

Yep, I created the pull request so it would only add to the branch, not master - thanks!

@jwakely jwakely deleted the motions-2016-11-lwg-11 branch November 19, 2016 00:42
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

2 participants