Fill an uninitialized array with copies of a value.
Declared in <bslalg_arrayprimitives.h>
template<class ALLOCATOR>
static
void
uninitializedFillN(
bsl::allocator_traits<ALLOCATOR>::pointer begin,
size_type numElements,
bsl::allocator_traits<ALLOCATOR>::value_type const& value,
ALLOCATOR allocator);
Construct copies of the specified value of type given by the allocator_traits class template for (template parameter) ALLOCATOR into the uninitialized array containing the specified numElements starting at the specified begin location. The behavior is undefined unless the output array contains at least numElements uninitialized elements after begin. If a constructor throws an exception during the operation, then the destructor is called on any newly-constructed elements, leaving the output array in an uninitialized state.
| Name | Description |
|---|---|
| begin | beginning of the uninitialized destination range |
| numElements | number of copies of value to construct |
| value | value copied into each constructed element |
| allocator | allocator used to supply memory if required |