osuplusplus/include/util_stream_ops.hpp

26 lines
627 B
C++
Raw Normal View History

#pragma once
#include <concepts>
#include <sstream>
#include <vector>
#include <SFML/Graphics/Color.hpp>
inline std::ostream &operator<<(std::ostream &stream, const sf::Color &color) {
stream << "Color(" << color.r << ", " << color.g << ", " << color.b << ", " << color.a << ")";
return stream;
}
template <typename T>
inline std::ostream &operator<<(std::ostream &stream, const std::vector<T> &vec) {
stream << "[";
for (size_t i = 0; i < vec.size(); ++i) {
stream << vec.at(i);
if (i != vec.size() - 1) {
stream << ", ";
}
}
stream << "]";
return stream;
}