Converting data when output std container via ostream_iterator
It seems to me that if you want to insert an object into a stream, the "right" way to do it is normally to define an operator&lt;&lt; for that type. That goes for strongly typed enums just as much as it does for class/struct objects.

#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;utility&gt;
#include &lt;iterator&gt;

enum class colors { red, green, blue };
std::vector&lt;colors&gt; v = { colors::blue, colors::red };

std::ostream &amp;operator&lt;&lt;(std::ostream &amp;os, colors const &amp;c) {
    return os &lt;&lt; std::underlying_type&lt;colors&gt;::type(c);
}

int main() {
    std:copy(v.begin(), v.end(), std::ostream_iterator&lt;colors&gt;(std::cout, "\n"));
}


That seems simple and straightforward enough that I'd be at least a little surprised to see a substantially cleaner/simpler solution (at least in C++ as it's currently defined; obviously, it's open to argument that some other language or some future definition of C++ could make things cleaner).

Using something like std::transform puts the burden in the wrong place. It requires that all code that uses the type in question contain and encode "knowledge" of the internals of the enumeration. What you generally want is to contain the complexity and the internals of the type in one place, so the rest of the code can just work with its external interface. An external interface of stream &lt;&lt; object is simple and straightforward. Forcing the rest of the world to work with an interface of stream &lt;&lt; std::underlying_type&lt;colors&gt;::type(c); anything but straightforward or simple. It's ugly and nasty.