matrix: remove iostream include from the header

This commit is contained in:
Danny Robson 2021-04-12 17:17:24 +10:00
parent 0977fb89b3
commit 986e7d18d8
2 changed files with 26 additions and 14 deletions

View File

@ -349,3 +349,26 @@ cruft::to_euler (const matrix<Rows,Cols,T> &m)
template cruft::vector<3,float> cruft::to_euler (const matrix<3,3,float>&);
template cruft::vector<3,float> cruft::to_euler (const matrix<4,4,float>&);
///////////////////////////////////////////////////////////////////////////////
#include "iterator/infix.hpp"
#include "coord/iostream.hpp"
#include <ostream>
template <std::size_t Rows, std::size_t Cols, typename T>
std::ostream&
cruft::operator<< (std::ostream &os, matrix<Rows,Cols,T> const &m)
{
os << '[';
std::copy (
std::cbegin (m),
std::cend (m),
iterator::infix_iterator<decltype(m[0])> (os, ", ")
);
return os << ']';
}
template std::ostream& cruft::operator<< (std::ostream&, matrix<4,4,f32> const&);

View File

@ -544,22 +544,11 @@ namespace cruft {
}
#include "iterator/infix.hpp"
#include "coord/iostream.hpp"
#include <ostream>
#include <iosfwd>
namespace cruft {
///////////////////////////////////////////////////////////////////////////
template <std::size_t Rows, std::size_t Cols, typename T>
std::ostream&
operator<< (std::ostream &os, const matrix<Rows,Cols,T> &m)
{
os << '[';
std::copy (
std::cbegin (m),
std::cend (m),
iterator::infix_iterator<decltype(m[0])> (os, ", ")
);
return os << ']';
operator<< (std::ostream &os, matrix<Rows,Cols,T> const&);
}
};