| 104 | // Return intersection of sorted containers. |
| 105 | template <typename Container> |
| 106 | Container intersect(Container const& a, Container const& b) { |
| 107 | Container r; |
| 108 | std::set_intersection(a.begin(), a.end(), b.begin(), b.end(), std::inserter(r, r.end())); |
| 109 | return r; |
| 110 | } |
| 111 | |
| 112 | template <typename MapType1, typename MapType2> |
| 113 | bool mapMerge(MapType1& targetMap, MapType2 const& sourceMap, bool overwrite = false) { |