-
Notifications
You must be signed in to change notification settings - Fork 772
[optional.ctor], [expected.object.ctor] Add converts-from-any-cvref #5416
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
Conversation
I have an alternative fix for #5205 that adds three smaller alias templates: --- a/source/utilities.tex
+++ b/source/utilities.tex
@@ -2918,20 +2918,29 @@ [optional.optional.general]
other than \cv{} \tcode{in_place_t} or \cv{} \tcode{nullopt_t}
that meets the \oldconcept{Destructible} requirements (\tref{cpp17.destructible}).
-\rSec3[optional.ctor]{Constructors}
-
\pnum
-The exposition-only alias template \exposid{converts-from-any-cvref}
-is used by some constructors for \tcode{optional}.
+The exposition-only alias templates
+\exposid{construct-from-any-cvref},
+\exposid{convert-from-any-cvref}, and\brk
+\exposid{assign-from-any-cvref}
+are used by some members of \tcode{optional}.
\begin{codeblock}
template<class T, class W>
-using @\exposid{converts-from-any-cvref}@ // \expos
+using @\exposid{construct-from-any-cvref}@ // \expos
= disjunction<is_constructible<T, W&>, is_constructible<T, W>,
- is_constructible<T, const W&>, is_constructible<T, const W>,
- is_convertible<W&, T>, is_convertible<W, T>,
+ is_constructible<T, const W&>, is_constructible<T, const W>>;
+template<class T, class W>
+using @\exposid{convert-from-any-cvref}@ // \expos
+ = disjunction<is_convertible<W&, T>, is_convertible<W, T>,
is_convertible<const W&, T>, is_convertible<const W, T>>;
+template<class T, class W>
+using @\exposid{assign-from-any-cvref}@ // \expos
+ = disjunction<is_assignable<T&, W&>, is_assignable<T&, W>,
+ is_assignable<T&, const W&>, is_assignable<T&, const W>>;
\end{codeblock}
+\rSec3[optional.ctor]{Constructors}
+
\indexlibraryctor{optional}%
\begin{itemdecl}
constexpr optional() noexcept; This allows further simplifying |
Looks good. But |
Rebased to combine the review comment fixes, and change "The exposition-only |
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.
This is a nice approach.
@jwakely I think this is back in your court? |
🎾 |
@JohelEGP gave it a 👍 but was there any other interest in the approach sketched at #5416 (comment) ? i.e. three smaller exposition-only helpers, instead of the big converts-from-any-cvref one? The latter is what's proposed by this pull request now, and what has been reviewed. |
I suppose we could do that later, as a further simplification, and just go with this for now. |
@jensmaurer Final thoughts? |
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.
Looks good.
Fixes #5205