-
Notifications
You must be signed in to change notification settings - Fork 214
Description
I wanted to open a PR for these but it seems that the proposal isn't open-sourced.
I've found some issues in the latest proposal for now (P3086R5).
- The term "trivial type" is deprecated by P3247R2. Instead of saying "
Xis a trivial type", perhaps we should say "is_trivially_copyable_v<X>andis_trivially_default_constructible_v<X>are bothtrue". - The "Constraints" element ([structure.specifications]/3.1) is not used.
- The "Require" element has been removed from [structure.specifications]. Given its only usage specifies conditions entirely detectible at compile time, it should be replaced with "Mandates".
- Given
constraint_levelis a scoped enumeration type, its underlying type is fixed and implicit specified asintper the current wording, and hence a value larger thanconstraint_level::trivialor less thanconstraint_level::none(e.g.constraint_level(127)orconstraint_level(-1)respectively) can be valid. Perhaps we don't want to accidently make such a value have valid effect.
E.g. I think it's clearer to specify the copy and move constructors as following.
proxy(const proxy& rhs) noexcept(F::copyability == constraint_level::trivial || F::copyability == constraint_level::nothrow);-?-. Effects: If
rhscontains a value of typeP, direct-non-list-initializes the contained value of the constructed object with aconst Plvalue that refers torhs’s contained value. Otherwise, constructs an emptyproxy.-?-. Remarks: This constructor is trivial if
F::copyability == constraint_level::trivialistrue, and deleted ifF::copyability == constraint_level::trivial,F::copyability == constraint_level::nothrow,F::copyability == constraint_level::nontrivialare allfalse.
[Drafting note: It is redundant to say a trivial copy constructor performs a bitwise copy.]
proxy(proxy&& rhs) noexcept(F::relocatability == constraint_level::nothrow);-?-. Constraints: Either
F::relocatability == constraint_level::nontrivialorF::copyability == constraint_level::nothrowistrue.-?-. Effects: If
rhscontains a value of typeP, moves its contained value into the constructed object (using either a move construction ofPor an implementation-defined trivial relocation when permitted by the constraint levels). Otherwise, constructs an empty proxy.-?-. Postconditions:
rhsdoes not contain a value.