osuplusplus/include/util_stream_ops.hpp
jacekpoz 19ff37e7b8
massively improve the awk fuckery
thank you krizej I actually forgot about g++ -D
2024-04-25 11:49:09 +02:00

27 lines
651 B
C++

#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;
}