C++ named requirements: CopyInsertable (since C++11)
Specifies that an instance of the type can be copy-constructed in-place by a given allocator.
Given the following types, values and expressions:
|an object type
|an allocator type
| a container type satisfying all following conditions:
| an lvalue of type
| a pointer of type
| an expression denoting an lvalue of type
T / const T, or an rvalue of type const T
|std::allocator_traits<A>::construct(m, p, v)
T is CopyInsertable into
X if all following conditions are satisfied:
- expr is valid.
- Evaluating expr does not change the value of v.
- Right after the evaluation of expr, the value of v is equivalent to *p.
Although it is required that customized
construct is used when constructing elements of std::basic_string until C++23, all implementations only used the default mechanism. The requirement is corrected by P1072R10 to match existing practice.
 Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
|Behavior as published
|v could denote an rvalue of type