How can I improve the design of this serialization mechanism?
You can use an internal traits type to reduce redundancy and complexity.

template&lt; typename serialized &gt;
struct serialize_traits; // no implementation of general case

enum class serialize_style {
    string,
    integral
};

typedef std::vector&lt; char &gt; serial_type; // consider std::string instead

template&lt;&gt;
struct serialize_traits&lt; char * &gt; {
    static const serialize_style style = serialize_style::string;
};

template&lt;&gt;
struct serialize_traits&lt; std::string &gt; {
    static const serialize_style style = serialize_style::string;
};

// Since serializer has no state, I broke this into a free function.
/* It works with both char * and std::string, but uses std::enable_if
   to hide itself unless you specify in serialize_traits that it will work. */

template &lt; typename serialized &gt;
typename std::enable_if&lt; serialize_traits&lt; serialized &gt;::style == serialize_style::string,
serial_type &gt;::type
serialize( serialized const &amp;in ) {
    using std::begin;
    using std::end;
    return serial_type( begin( in ), end( in ) );
}


I need to go so I'll post this now… not tested.