colour: use numeric_iterator and make_infix for ostream
This commit is contained in:
parent
ba2eb48d63
commit
c0e8a947d0
11
colour.cpp
11
colour.cpp
@ -384,12 +384,9 @@ namespace json::tree {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template <size_t S, typename T>
|
||||
std::ostream&
|
||||
util::operator<< (std::ostream &os, util::colour<S,T> c) {
|
||||
os << "colour(";
|
||||
for (size_t i = 0; i < S - 1; ++i)
|
||||
os << +c[i] << ", ";
|
||||
os << +c[S-1] << ")";
|
||||
return os;
|
||||
util::operator<< (std::ostream &os, util::colour<S,T> c)
|
||||
{
|
||||
return os << "[ " << util::make_infix (util::numeric_view (c), ", ") << ']';
|
||||
}
|
||||
|
||||
|
||||
@ -438,8 +435,10 @@ util::operator>> (std::istream &is, util::colour<S,T> &c)
|
||||
return is;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template std::istream& util::operator>> (std::istream&, util::colour<3,uint8_t>&);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INSTANTIATE_S_T(S,T) \
|
||||
template \
|
||||
|
Loading…
Reference in New Issue
Block a user