#include #include template std::ostream & operator<<(std::ostream & stream, const std::vector & what) { stream << "vector(size = " << what.size() << ", capacity = " << what.capacity() << "){"; bool first = true; for (const auto & i : what) { if (!first) stream << ", "; first = false; stream << i; } stream << "}"; return stream; } #include template std::ostream & operator<<(std::ostream & stream, const std::array & what) { stream << "array<" << what.size() << ">{"; bool first = true; for (const auto & i : what) { if (!first) stream << ", "; first = false; stream << i; } stream << "}"; return stream; } #include template std::ostream & operator<<(std::ostream & stream, const std::map & what) { stream << "map(size = " << what.size() << "){"; bool first = true; for (const auto & i : what) { if (!first) stream << ", "; first = false; stream << i.first << ": " << i.second; } stream << "}"; return stream; } #include template std::ostream & operator<<(std::ostream & stream, const std::unordered_map & what) { stream << "unordered_map(size = " << what.size() << "){"; bool first = true; for (const auto & i : what) { if (!first) stream << ", "; first = false; stream << i.first << ": " << i.second; } stream << "}"; return stream; } #include template std::ostream & operator<<(std::ostream & stream, const std::pair & what) { stream << "pair{" << what.first << ", " << what.second << "}"; return stream; } #include template std::ostream & operator<<(std::ostream & stream, const std::ratio & what) { stream << "ratio"; return stream; } #include template std::ostream & operator<<(std::ostream & stream, const std::chrono::duration & what) { stream << "chrono::duration{" << what.count() << "}"; return stream; } template std::ostream & operator<<(std::ostream & stream, const std::chrono::time_point & what) { stream << "chrono::time_point{" << what.time_since_epoch() << "}"; return stream; } // TODO: add more types