colour: prefer to avoid stream::numeric for output

This commit is contained in:
Danny Robson 2016-04-02 13:37:09 +11:00
parent b867298093
commit 87482522d7

View File

@ -378,20 +378,18 @@ namespace util {
} }
//----------------------------------------------------------------------------- ///////////////////////////////////////////////////////////////////////////////
template <size_t S, typename T> template <size_t S, typename T>
std::ostream& std::ostream&
util::operator<< (std::ostream &os, util::colour<S,T> c) { util::operator<< (std::ostream &os, util::colour<S,T> c) {
os << "["; os << "colour(";
std::transform (std::cbegin (c), for (size_t i = 0; i < S - 1; ++i)
std::cend (c), os << +c[i] << ", ";
infix_iterator<stream::numeric<T>> (os, ", "), os << +c[S-1] << ")";
stream::to_numeric<T>);
os << "]";
return os; return os;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#define INSTANTIATE_S_T(S,T) \ #define INSTANTIATE_S_T(S,T) \
template struct util::colour<S,T>; \ template struct util::colour<S,T>; \