@@ -46,19 +46,22 @@ struct map_difference {
46
46
{ }
47
47
};
48
48
49
+ /* *
50
+ * Produces a map_difference between the two specified maps, with Key keys and
51
+ * Tp values, using the provided equality function. In order to work with any
52
+ * map type, such as std::map and std::unordered_map, Args holds the remaining
53
+ * type parameters of the particular map type.
54
+ */
49
55
template <template <typename ...> class Map ,
50
56
typename Key,
51
57
typename Tp,
52
- typename Compare = std::less<Key>,
53
58
typename Eq = std::equal_to<Tp>,
54
- typename Alloc >
59
+ typename ... Args >
55
60
inline
56
61
map_difference<Key>
57
- difference (const Map<Key, Tp, Compare, Alloc>& left,
58
- const Map<Key, Tp, Compare, Alloc>& right,
59
- Compare key_comp = Compare(),
60
- Eq equals = Eq(),
61
- Alloc alloc = Alloc())
62
+ difference (const Map<Key, Tp, Args...>& left,
63
+ const Map<Key, Tp, Args...>& right,
64
+ Eq equals = Eq())
62
65
{
63
66
map_difference<Key> diff{};
64
67
for (auto && kv : right) {
@@ -82,10 +85,3 @@ difference(const Map<Key, Tp, Compare, Alloc>& left,
82
85
}
83
86
return diff;
84
87
}
85
-
86
- template <typename Key, typename Tp, typename Compare, typename Eq, typename Alloc>
87
- inline
88
- map_difference<Key>
89
- difference (const std::map<Key, Tp, Compare, Alloc>& left, const std::map<Key, Tp, Compare, Alloc>& right, Eq equals) {
90
- return difference (left, right, left.key_comp (), equals);
91
- }
0 commit comments