CBMC
|
#include <set>
Go to the source code of this file.
Functions | |
template<class T , class Compare , class Alloc > | |
bool | util_inplace_set_union (std::set< T, Compare, Alloc > &target, const std::set< T, Compare, Alloc > &source) |
Compute union of two sets. More... | |
bool util_inplace_set_union | ( | std::set< T, Compare, Alloc > & | target, |
const std::set< T, Compare, Alloc > & | source | ||
) |
Compute union of two sets.
This function has complexity O(max(n1, n2)), with n1, n2 being the sizes of the sets of which the union is formed. This is in contrast to target.insert(source.begin(), source.end())
which has complexity O(n2 * log(n1 + n2)).
T | value type of the sets |
Compare | comparison predicate of the sets |
Alloc | allocator of the sets |
target | first input set, will contain the result of the union |
source | second input set |
target
was changed Definition at line 28 of file container_utils.h.