Avoid opening namespace std
This commit is contained in:
parent
8561101b11
commit
45986c6400
@ -4,19 +4,26 @@
|
|||||||
#include <doctest/doctest.h>
|
#include <doctest/doctest.h>
|
||||||
|
|
||||||
#include <GraphicsUtil.hpp>
|
#include <GraphicsUtil.hpp>
|
||||||
|
#include <cassert>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace std
|
// Use StringMaker to avoid opening namespace std
|
||||||
|
namespace doctest
|
||||||
{
|
{
|
||||||
std::ostream& operator<<(std::ostream& out, const std::vector<float>& vector)
|
template <>
|
||||||
|
struct StringMaker<std::vector<float>>
|
||||||
{
|
{
|
||||||
out << "{ ";
|
static String convert(const std::vector<float>& vector)
|
||||||
|
{
|
||||||
|
assert(!vector.empty());
|
||||||
|
doctest::String out = "{ ";
|
||||||
for (size_t i = 0; i + 1 < vector.size(); ++i)
|
for (size_t i = 0; i + 1 < vector.size(); ++i)
|
||||||
out << vector[i] << ", ";
|
out += toString(vector[i]) + ", ";
|
||||||
out << vector.back() << " }";
|
out += toString(vector.back()) + " }";
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
} // namespace std
|
};
|
||||||
|
} // namespace doctest
|
||||||
|
|
||||||
TEST_CASE("sf::Transform class - [graphics]")
|
TEST_CASE("sf::Transform class - [graphics]")
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user