Add prints for multimap and unordered_map

This commit is contained in:
Thraix
2025-12-09 22:13:24 +01:00
parent 90bbec630e
commit f5e809d086
+32
View File
@@ -708,6 +708,38 @@ static std::ostream& operator<<(std::ostream& stream, const std::map<T, S>& cont
return stream;
}
template <typename T, typename S>
static std::ostream& operator<<(std::ostream& stream, const std::multimap<T, S>& container)
{
stream << "{";
int i = 0;
for (const auto& [t, s] : container)
{
if (i != 0)
stream << ", ";
stream << t << " => " << s;
i++;
}
stream << "}";
return stream;
}
template <typename T, typename S>
static std::ostream& operator<<(std::ostream& stream, const std::unordered_map<T, S>& container)
{
stream << "{";
int i = 0;
for (const auto& [t, s] : container)
{
if (i != 0)
stream << ", ";
stream << t << " => " << s;
i++;
}
stream << "}";
return stream;
}
template <typename T, typename S>
static std::ostream& operator<<(std::ostream& stream, const std::pair<T, S>& pair)
{