Create a multiset from the specified range.

Synopsis

Declared in <bslstl_multiset.h>

template<class RANGE>
multiset(
    std::from_range_t tag,
    RANGE&& range,
    COMPARATOR const& comparator = COMPARATOR(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());

Description

Create a multiset having the (value_type) values obtained from the specified range. Ignore those those objects having a key equivalent to that which appears earlier in the sequence. Optionally specify a comparator used to order key‐value pairs contained in this object. If comparator is not supplied, a default‐constructed object of the (template parameter) type COMPARATOR is used. 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. If values obtained from `range are ordered according to comparator, then this operation has O[N] complexity, where N is the number of values in the range; otherwise, this operation has O[N * log(N)] complexity. Note that RANGE must meet the requirements of an input range and the values from range must have a type matching or convertible to value_type.

Parameters

Name

Description

tag

disambiguation tag selecting the range constructor

range

input range of elements to insert

comparator

key‐ordering comparator for this multiset

basicAllocator

allocator used to supply memory

Created with MrDocs