mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Do not require overriding for functions in common base with unique implementation.
This commit is contained in:
committed by
chriseth
parent
071a52f0ff
commit
4c7f9f9751
+14
-6
@@ -112,24 +112,32 @@ inline std::set<T> operator+(std::set<T>&& _a, U&& _b)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// Remove one set from another one.
|
||||
template <class... T>
|
||||
inline std::set<T...>& operator-=(std::set<T...>& _a, std::set<T...> const& _b)
|
||||
/// Remove the elements of a container from a set.
|
||||
template <class C, class... T>
|
||||
inline std::set<T...>& operator-=(std::set<T...>& _a, C const& _b)
|
||||
{
|
||||
for (auto const& x: _b)
|
||||
_a.erase(x);
|
||||
return _a;
|
||||
}
|
||||
|
||||
template <class... T>
|
||||
inline std::set<T...> operator-(std::set<T...> const& _a, std::set<T...> const& _b)
|
||||
template <class C, class... T>
|
||||
inline std::set<T...> operator-(std::set<T...> const& _a, C const& _b)
|
||||
{
|
||||
auto result = _a;
|
||||
result -= _b;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// Remove the elements of a container from a multiset.
|
||||
template <class C, class... T>
|
||||
inline std::multiset<T...>& operator-=(std::multiset<T...>& _a, C const& _b)
|
||||
{
|
||||
for (auto const& x: _b)
|
||||
_a.erase(x);
|
||||
return _a;
|
||||
}
|
||||
|
||||
namespace dev
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user