This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++20 status.
Section: 29.2 [numeric.requirements] Status: C++20 Submitter: Tim Song Opened: 2018-07-05 Last modified: 2021-02-25
29.2 [numeric.requirements] contains some very old wording that hasn't been changed since C++98 except for issue 2699(i). As a result, it is at once over- and under-restrictive. For example:
We can significantly clean up this wording by using the existing named requirements. For ease of review, the following table provides a side-by-side comparison of the current and proposed wording.
Before After A C++ program shall instantiate these components only with a typeT
that satisfies the following requirements: [Footnote … ] A C++ program shall instantiate these components only with a cv-unqualified object type T
that satisfies the Cpp17DefaultConstructible, Cpp17CopyConstructible, Cpp17CopyAssignable, and Cpp17Destructible following requirements (16.4.4.2 [utility.arg.requirements]). : (1.1) — T
is not an abstract class (it has no pure virtual member functions); Cpp17DefaultConstructible (1.2) — T
is not a reference type;
T
is not cv-qualified; Implied by "cv-unqualified object type" (1.4) — If T
is a class, it has a public default constructor; Cpp17DefaultConstructible (1.5) — If T
is a class, it has a public copy constructor with the signature T::T(const T&)
; Cpp17CopyConstructible (1.6) — If T
is a class, it has a public destructor; Cpp17Destructible (1.7) — If T
is a class, it has a public copy assignment operator whose signature is either T& T::operator=(const T&)
or T& T::operator=(T);
Cpp17CopyAssignable (1.8) — If T
is a class, its assignment operator, copy and default constructors, and destructor shall correspond to each other in the following sense:
T()
, however obtained, is semantically equivalent to value-initialization of the same raw storage.
T
is a class, it does not overload unary operator&
. omitted now that we have std::addressof
This wording is relative to the post-Rapperswil 2018 working draft.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4