osuplusplus/include/util_stream_ops.hpp

28 lines
651 B
C++
Raw Permalink Normal View History

#pragma once
#ifndef PP_DEBUG
#include <concepts>
#include <sstream>
#include <vector>
#include <SFML/Graphics/Color.hpp>
#endif
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;
}