Files
2025-10-25 03:02:53 +03:00

31 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[flat.set.cons]
# 23 Containers library [[containers]](./#containers)
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#flat.set.cons)
### 23.6.11 Class template flat_set [[flat.set]](flat.set#cons)
#### 23.6.11.3 Constructors [flat.set.cons]
[🔗](#lib:flat_set,constructor)
`constexpr explicit flat_set(container_type cont, const key_compare& comp = key_compare());
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L19167)
*Effects*: Initializes *c* with std::move(cont) and*compare* with comp,
sorts the range [begin(), end()) with respect to *compare*, and
finally erases all but the first element
from each group of consecutive equivalent elements[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L19175)
*Complexity*: Linear in N if cont is already sorted with respect to *compare* and
otherwise NlogN, where N is the value of cont.size() before this call[.](#2.sentence-1)