mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Add operator<< for std::map
This is to allow chaining inserts and to avoid temporary variables when inserting maps returned from functions.
This commit is contained in:
@@ -57,4 +57,11 @@ namespace oak
|
||||
}
|
||||
};
|
||||
|
||||
template <typename _SrcKeyT, typename _SrcValueT, typename _DstKeyT, typename _DstValueT>
|
||||
std::map<_SrcKeyT, _SrcValueT>& operator<< (std::map<_DstKeyT, _DstValueT>& dst, std::map<_SrcKeyT, _SrcValueT> const& src)
|
||||
{
|
||||
dst.insert(src.begin(), src.end());
|
||||
return dst;
|
||||
}
|
||||
|
||||
#endif /* end of include guard: OAK_ALGORITHM_H_E3HYH9S3 */
|
||||
|
||||
Reference in New Issue
Block a user