Create a set from the values in the specified range.
Synopsis
Declared in <bslstl_set.h>
template<class RANGE>
set(
std::from_range_t tag,
RANGE&& range,
COMPARATOR const& comparator = COMPARATOR(),
ALLOCATOR const& basicAllocator = ALLOCATOR());
Description
Ignore 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 for the range constructor |
range |
range of values to insert |
comparator |
key‐comparison functor |
basicAllocator |
allocator used to supply memory |
Created with MrDocs