maintaining pair of elemts using own class template
<p>I made my own class template to maintain pair of elements of any type of objects. Now I am going to use this template for another own class MyPoint. this contain 3D cordinates of a point. I think I need to modify this further as my final objective is to use this <code>PairInfor&lt;MyPoint&gt;</code> as a <code>vector&lt;PairInfor&lt;MyPoint&gt; &gt;</code> and again <code>vector&lt;vector&lt;PairInfor&lt;MyPoint&gt; &gt; &gt;</code>. SO, I need your support to modify this as I do not have very knowledge to prepare this types of templates.</p>

<p>I got assistant from some other classes and books, but i need to include most common functions to this. Can anyone help please?</p>

<p>Here is my template class;</p>

<pre><code>// class to accomadate two values
//-------------------------------

#include &lt;stdlib.h&gt;
#include &lt;iostream&gt;    

template &lt;class Type&gt;
class PairInfor {

private:
        /// two elements of the pair
    Type x[2];


public:
    // Default constructor.
    PairInfor() { x[0] = x[1] = -1; }

    // other Constructors.
    PairInfor(Type xv, Type yv) {
        x[0] = xv; x[1] = yv;
    }

    PairInfor(const Type *v) { x[0] = v[0]; x[1] = v[1]; }  


    //constructor for Coping
    PairInfor(const PairInfor &amp;v) { x[0] = v.x[0]; x[1] = v.x[1]; }

    // Destructor.
    ~PairInfor() {}

        // assignament
        PairInfor&amp; operator=(const PairInfor &amp;v)
          { x[0] = v.x[0]; x[1] = v.x[1]; 
            return *this;
          }


    // Element access, for getting.
    Type V1() const { return x[0]; }


    // Element access, for getting.
    Type V2() const { return x[1]; }


    // Element access, for getting.
    Type operator[] (int i) const { return x[i]; }



    // Element access, for writing.
    Type &amp;V1() { return x[0]; }


    // Element access, for writing.
    Type &amp;V2() { return x[1]; }


    // Element access, for writing.
    Type &amp;operator[] (int i) { return x[i]; }


    // Return a constant reference to the pair
    const class PairInfor &amp;infor() const { return *this; }

    // Return a reference to the pair
    PairInfor &amp;infor() { return *this; }

    // comparing two pair packets
    friend bool operator == (const PairInfor &amp;v1, const PairInfor &amp;v2) 
    { 
         return v1.x[0] == v2.x[0] &amp;&amp; v1.x[1] == v2.x[1]; 
    } 

};
</code></pre>

<p>When I use this template class, I get the following error too.</p>

<pre><code>\include\PairInfor.hpp In constructor `PairInfor&lt;Type&gt;::PairInfor() [with Type = MyPoint]': 
\myprogf.cpp   instantiated from here 
\include\PairInfor.hpp invalid conversion from `int' to `char*' 
\include\PairInfor.hpp   initializing argument 1 of `MyPoint::MyPoint(char*)' 
\Makefile.win [Build Error]  [myprogf.o] Error 1 
</code></pre>

<p>How do I solve this error. Is the error with my default constructor in PairInfor. How do I solve this please?
Thanks in advance.</p>
