title: Problem with c++ template constructor
body: <p>code:</p>
  
  <pre><code>#include&lt;iostream&gt;
  
  using namespace std;
  
  template&lt;class T, int N&gt; class point {
      T coordinate[N];
  public:
      point(const point&lt;T,N&gt;&amp;);
      const double&amp; operator[](int i) const {
          return coordinate[i];
      }
  };
  
  template&lt;class T, int N&gt; point&lt;T,N&gt;::point(const point&lt;T,N&gt;&amp;p)
  {
      for(int i=0;i&lt;N;i++)
          coordinate[i]=p.coordinate[i];
  };
  
  int main() {
      point&lt;int,2&gt; P2;
      point&lt;double,3&gt; P3;
      cout&lt;&lt;P2[0]&lt;&lt;P3[1];
      return 0;
  }
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>prog.cpp: In function ‘int main()’:
  prog.cpp:17: error: no matching function for call to ‘point&lt;int, 2&gt;::point()’
  prog.cpp:11: note: candidates are: point&lt;T, N&gt;::point(const point&lt;T, N&gt;&amp;) [with T =
               int, int N = 2]
  prog.cpp:18: error: no matching function for call to ‘point&lt;double, 3&gt;::point()’
  prog.cpp:11: note: candidates are: point&lt;T, N&gt;::point(const point&lt;T, N&gt;&amp;) [with T =
               double, int N = 3]
  prog.cpp: In member function ‘const double&amp; point&lt;T, N&gt;::operator[](int) const [with
            T = int, int N = 2]’:
  prog.cpp:19:   instantiated from here
  prog.cpp:8: warning: returning reference to temporary
  </code></pre>
  
  <p>Please help me sort out the faults.</p>