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&
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<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 << "}";
return os << "physical_device { "
<< "extensions: [ " << util::make_infix (d.extensions ()) << " ]"
<< ", properties: " << d.properties ()
<< ", features: " << d.features ()
<< ", queues: [ " << util::make_infix (d.queue_families ()) << " ]"
<< " }";
}