ostream: use make_infix for output iterators

This commit is contained in:
Danny Robson 2017-09-01 13:36:47 +10:00
parent 2a61e8c4ea
commit 78a0030c2c

View File

@ -135,27 +135,12 @@ operator<< (std::ostream &os, const VkPhysicalDeviceFeatures &f)
std::ostream& std::ostream&
cruft::vk::operator<< (std::ostream &os, const physical_device &d) cruft::vk::operator<< (std::ostream &os, const physical_device &d)
{ {
os << "physical_device { "; return os << "physical_device { "
<< "extensions: [ " << util::make_infix (d.extensions ()) << " ]"
os << "extensions: [ "; << ", properties: " << d.properties ()
const auto &extensions = d.extensions (); << ", features: " << d.features ()
std::copy (std::cbegin (extensions), << ", queues: [ " << util::make_infix (d.queue_families ()) << " ]"
std::cend (extensions), << " }";
util::infix_iterator<std::string> (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<VkQueueFamilyProperties> (os, ", ")
);
return os << "}";
} }