Create a list of numElements copies of value.

Synopsis

Declared in <bslstl_list.h>

list(
    size_type numElements,
    value_type const& value,
    ALLOCATOR const& basicAllocator = ALLOCATOR());

Description

Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default‐constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. Throw bsl::length_error if numElements > max_size(). This method requires that the (template parameter) VALUE be copy‐insertable into this list (see {Requirements on VALUE}).

Parameters

Name

Description

numElements

number of elements to create

value

value copied into each element

basicAllocator

allocator used to supply memory

Created with MrDocs