@ -17950,14 +17950,14 @@ Most uses support that anyway.
explicit X(int);
X(const X&); // copy
X operator=(const X&);
X(X&&) noexcept; // move
X(X&&) noexcept; // move
X& operator=(X&&) noexcept;
~X();
// ... no more constructors ...
};
X x {1}; // fine
X y = x; // fine
X x {1}; // fine
X y = x; // fine
std::vector<X> v(10); // error: no default constructor
##### Note
@ -18381,7 +18381,7 @@ There are three major ways to let calling code customize a template.
void test2(T t)
// Call a non-member function without qualification
{
f(t); // require f(/*T*/) be available in caller's scope or in T's namespace
f(t); // require f(/*T*/) be available in caller's scope or in T's namespace
}
template<classT>
@ -18980,7 +18980,7 @@ You can't partially specialize a function template per language rules. You can f
##### Reason
If you intend for a class to match a concept, verifying that early saves users pain.
If you intend for a class to match a concept, verifying that early saves users' pain.
##### Example
@ -19519,7 +19519,7 @@ For example:
#include<random>
#include<vector>
a user can now get that set of declarations with a single `#include`"
a user can now get that set of declarations with a single `#include`
#include "basic_std_lib.h"
@ -19745,7 +19745,7 @@ For a variable-length array, use `std::vector`, which additionally can change it
int v[SIZE]; // BAD
std::array<int,SIZE> w; // ok
std::array<int,SIZE> w; // ok
##### Example
@ -22295,7 +22295,7 @@ Never allow an error to be reported from a destructor, a resource deallocation f
void test()
{
std::array<Nefarious,10> arr; // this line can std::terminate(!)
std::array<Nefarious,10> arr; // this line can std::terminate()
}
The behavior of arrays is undefined in the presence of destructors that throw because there is no reasonable rollback behavior that could ever be devised. Just think: What code can the compiler generate for constructing an `arr` where, if the fourth object's constructor throws, the code has to give up and in its cleanup mode tries to call the destructors of the already-constructed objects ... and one or more of those destructors throws? There is no satisfactory answer.