Write formatted mac addresss to stringstream
<p>I have a the following class (only partial, much more fields in a class)</p>

<pre><code>class Network{
public:
      string src_ip_;
      string alternative_src_ip_;
      array&lt;unsigned char,6&gt; mac_;
      string toString(){
           stringstream ss;
           ss &lt;&lt; src_ip_ &lt;&lt; SEPERATOR &lt;&lt; alternative_src_ip_ &lt;&lt; SEPERATOR ;
           return ss.str();
      }
}
</code></pre>

<p>I want to add a formatted mac (with :) to the toString method?
Is there a simple way to adopt my printMac method (by generelize or by write new one) that will do this with combined in the &lt;&lt; operator </p>

<pre><code>void printMac(array&lt;unsigned char, 6&gt; mac) {
    printf("%02x:%02x:%02x:%02x:%02x:%02x\n", 
            (unsigned char) mac[0], (unsigned char) mac[1],
            (unsigned char) mac[2], (unsigned char) mac[3],
            (unsigned char) mac[4], (unsigned char) mac[5]);
}
</code></pre>
