From 78a0030c2c8117372141dd18e221ac003ebf2be3 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 1 Sep 2017 13:36:47 +1000 Subject: [PATCH] ostream: use make_infix for output iterators --- ostream.cpp | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/ostream.cpp b/ostream.cpp index f51861d..6543377 100644 --- a/ostream.cpp +++ b/ostream.cpp @@ -135,27 +135,12 @@ operator<< (std::ostream &os, const VkPhysicalDeviceFeatures &f) std::ostream& cruft::vk::operator<< (std::ostream &os, const physical_device &d) { - os << "physical_device { "; - - os << "extensions: [ "; - const auto &extensions = d.extensions (); - std::copy (std::cbegin (extensions), - std::cend (extensions), - util::infix_iterator (os, ", ")); - os << " ], "; - - os << " properties: " << d.properties () - << ", features: " << d.features (); - - os << ", queues: "; - const auto &queues = d.queue_families (); - std::copy ( - std::cbegin (queues), - std::cend (queues), - util::infix_iterator (os, ", ") - ); - - return os << "}"; + return os << "physical_device { " + << "extensions: [ " << util::make_infix (d.extensions ()) << " ]" + << ", properties: " << d.properties () + << ", features: " << d.features () + << ", queues: [ " << util::make_infix (d.queue_families ()) << " ]" + << " }"; }