coord: use new template form in ostream operators
This commit is contained in:
parent
a8088d03cd
commit
a0b0863d61
@ -17,6 +17,7 @@
|
|||||||
#ifndef CRUFT_UTIL_IOSTREAM
|
#ifndef CRUFT_UTIL_IOSTREAM
|
||||||
#define CRUFT_UTIL_IOSTREAM
|
#define CRUFT_UTIL_IOSTREAM
|
||||||
|
|
||||||
|
#include "./traits.hpp"
|
||||||
#include "../iterator.hpp"
|
#include "../iterator.hpp"
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
@ -25,17 +26,16 @@
|
|||||||
|
|
||||||
namespace util {
|
namespace util {
|
||||||
template <
|
template <
|
||||||
template <std::size_t,typename> class K,
|
typename K,
|
||||||
std::size_t S,
|
typename = std::enable_if_t<is_coord_v<K>,void>
|
||||||
typename T
|
|
||||||
>
|
>
|
||||||
std::ostream&
|
std::ostream&
|
||||||
operator<< (std::ostream &os, const K<S,T> &k)
|
operator<< (std::ostream &os, const K &k)
|
||||||
{
|
{
|
||||||
os << "[";
|
os << "[";
|
||||||
std::transform (std::cbegin (k),
|
std::transform (std::cbegin (k),
|
||||||
std::cend (k),
|
std::cend (k),
|
||||||
infix_iterator<T> (os, ", "),
|
infix_iterator<typename K::value_type> (os, ", "),
|
||||||
[] (auto i) { return +i; });
|
[] (auto i) { return +i; });
|
||||||
os << "]";
|
os << "]";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user