Difference between revisions of "cpp/iterator/mergeable"
From cppreference.com
m |
D41D8CD98F (Talk | contribs) (rename template parameters) |
||
Line 4: | Line 4: | ||
{{dcl header | iterator}} | {{dcl header | iterator}} | ||
{{dcl | since=c++20 | 1= | {{dcl | since=c++20 | 1= | ||
− | template< class I1, class I2, class Out, class | + | template< class I1, class I2, class Out, class Comp = ranges::less, |
− | class | + | class Proj1 = std::identity, class Proj2 = std::identity > |
concept mergeable = | concept mergeable = | ||
std::input_iterator<I1> && | std::input_iterator<I1> && | ||
Line 12: | Line 12: | ||
std::indirectly_copyable<I1, Out> && | std::indirectly_copyable<I1, Out> && | ||
std::indirectly_copyable<I2, Out> && | std::indirectly_copyable<I2, Out> && | ||
− | std::indirect_strict_weak_order< | + | std::indirect_strict_weak_order<Comp, |
− | std::projected<I1, | + | std::projected<I1, Proj1>, |
− | std::projected<I2, | + | std::projected<I2, Proj2>>; |
}} | }} | ||
{{dcl end}} | {{dcl end}} | ||
− | The {{tt|mergeable}} concept specifies the requirements for algorithms that merge two input ranges into a single output range according to the strict weak ordering imposed by {{tt| | + | The {{tt|mergeable}} concept specifies the requirements for algorithms that merge two input ranges into a single output range according to the strict weak ordering imposed by {{tt|Comp}}. |
===Semantic requirements=== | ===Semantic requirements=== | ||
− | {{tt|mergeable}} is only if all concepts it subsumes are modeled. | + | {{tt|mergeable}} is modeled only if all concepts it subsumes are modeled. |
===See also=== | ===See also=== |
Latest revision as of 23:05, 2 October 2021
Defined in header <iterator>
|
||
template< class I1, class I2, class Out, class Comp = ranges::less, class Proj1 = std::identity, class Proj2 = std::identity > |
(since C++20) | |
The mergeable
concept specifies the requirements for algorithms that merge two input ranges into a single output range according to the strict weak ordering imposed by Comp
.
[edit] Semantic requirements
mergeable
is modeled only if all concepts it subsumes are modeled.
[edit] See also
(C++20) |
merges two sorted ranges (niebloid) |
(C++20) |
computes the union of two sets (niebloid) |
(C++20) |
computes the intersection of two sets (niebloid) |
(C++20) |
computes the difference between two sets (niebloid) |
computes the symmetric difference between two sets (niebloid) |