Aim: Specialize set operations (union, intersection, difference, symmetric_difference) according to the given type of container. It uses standard algorithms when containers are ordered, otherwise it provides a default implementation.
More...
template<typename Container, bool associative, bool ordered>
struct DGtal::detail::SetFunctionsImpl< Container, associative, ordered >
Aim: Specialize set operations (union, intersection, difference, symmetric_difference) according to the given type of container. It uses standard algorithms when containers are ordered, otherwise it provides a default implementation.
Description of template class 'SetFunctions'
- Template Parameters
-
| Container | any type of container. |
| associative | tells if the container is associative (e.g. set, map, unordered_set, unordered_map). |
| ordered | tells if the container is ordered (e.g., set, map). |
Specialized implementations are marked with (S) in the list below.
|-----------------—|----------—|-------—|-------—|
| Container | associative | ordered | pair |
| vector | false | false | false |
| list | false | false | false |
| (not valid) | false | false | true |
| sorted vector (S) | false | true | false |
| sorted list (S) | false | true | false |
| set (S) | true | true | false |
| map (S) | true | true | true |
| unordered_set (S) | true | false | false |
| unordered_map (S) | true | false | true |
- Note
- For pair containers (like map and unordered_map), the data is not taken into account, which means that it can be lost in some (modifier) operations.
-
It is illogical to have a containers that is not associative and that is a pair container, since the pair represents an association.
Definition at line 234 of file SetFunctions.h.