CatapultServer  v0.5.0.1 (Elephant)
BaseSetUtils.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include <algorithm>
23 
24 namespace catapult { namespace deltaset {
25 
28  template<typename TContainer, typename TElements>
29  bool ContainsAny(const TContainer& container, const TElements& elements) {
30  return std::any_of(elements.cbegin(), elements.cend(), [&container](const auto& pElement) {
31  return container.contains(pElement);
32  });
33  }
34 
37  template<typename TContainer, typename TElements>
38  void InsertAll(TContainer& container, const TElements& elements) {
39  for (const auto& pElement : elements)
40  container.insert(pElement);
41  }
42 
44  template<typename TContainer, typename TElements>
45  void RemoveAll(TContainer& container, const TElements& elements) {
46  for (const auto& pElement : elements)
47  container.remove(pElement);
48  }
49 }}
catapult::deltaset::InsertAll
void InsertAll(TContainer &container, const TElements &elements)
Definition: BaseSetUtils.h:38
catapult::deltaset::ContainsAny
bool ContainsAny(const TContainer &container, const TElements &elements)
Definition: BaseSetUtils.h:29
catapult::deltaset::RemoveAll
void RemoveAll(TContainer &container, const TElements &elements)
Removes all elements from the container (pContainer).
Definition: BaseSetUtils.h:45
catapult
Definition: AddressExtractionExtension.cpp:28