How to store a list of sets of three strings?
<pre><code>std::vector&lt;std::pair&lt;std::string &gt; &gt;
</code></pre>

<p>can be used to store a list of a pair of strings. Is there a similar way to store a list of triplets of strings?</p>

<p>One way I can think of is to use <code>std::vector</code></p>

<pre><code>std::vector&lt;std::vector&lt;std::string &gt; &gt; v (4, std::vector&lt;std::string&gt; (3));
</code></pre>

<p>but this will not allow me to use the handly <code>first</code> and <code>second</code> accessors.</p>

<p>So, I wrote my own class</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;
using namespace std;

template &lt;class T&gt;
class triad {
private:
    T* one;
    T* two;
    T* three;
public:
    triad() {  one = two = three =0;  }
    triad(triad&amp; t) {
        one = new T(t.get1());
        two = new T(t.get2());
        three = new T(t.get3());
    }
    ~triad() {
        delete one;
        delete two;
        delete three;
        one = 0;
        two = 0;
        three = 0;
    }
    T&amp; get1() { return *one; }
    T&amp; get2() { return *two; }
    T&amp; get3() { return *three; }
};

int main() {
    std::vector&lt; triad&lt;std::string&gt; &gt; v;
}
</code></pre>

<p>I have two questions</p>

<ol>
<li>Can my class code be improved in any way?</li>
<li>Is there any better way to do store triplets of strings than the three ways described above?</li>
</ol>
