What is wrong with my ctor using linked list and templates?
<p>I am trying to practice a little bit with cpp and want to make a class of linked list and than to manipulate it reverse it, finding circle and etc. but I can't understand what is the problem with my ctor/  </p>

<p>I have this main:</p>

<pre><code>#include "list.h"
#include &lt;iostream&gt;


using namespace std;


int main () {
  int x = 10;

  ListNode&lt;int&gt; node4();
  ListNode&lt;int&gt; node3(10 ,node4);
}
</code></pre>

<p>while this is "list.h" :</p>

<pre><code>#ifndef LIST_NODE_H
#define LIST_NODE_H

#include &lt;iostream&gt;
using namespace std;

template &lt;class T&gt;
class ListNode {

  ListNode* next;
  T data;

 public:

  ListNode&lt;T&gt;( T dat = 0 ,const ListNode&lt;T&gt; &amp;nex = NULL):data(dat),next(nex){};

};

#endif
</code></pre>

<p>I can't understand why this line: <code>ListNode&lt;int&gt; node3(10 ,node4);</code>
makes this errors, what is the problem?</p>

<blockquote>
  <p>list.cpp: In function ‘int main()’: list.cpp:12:33: error: invalid
  conversion from ‘ListNode (<em>)()’ to ‘int’ [-fpermissive]
  list.h:15:3: error:   initializing argument 1 of
  ‘ListNode::ListNode(T, const ListNode&amp;) [with T = int]’
  [-fpermissive] list.cpp:12:33: warning: passing NULL to non-pointer
  argument 1 of ‘ListNode::ListNode(T, const ListNode&amp;) [with T =
  int]’ [-Wconversion-null] list.cpp:12:33: error: recursive evaluation
  of default argument for ‘ListNode::ListNode(T, const ListNode&amp;)
  [with T = int]’ list.h:15:3: warning: in passing argument 2 of
  ‘ListNode::ListNode(T, const ListNode&amp;) [with T = int]’ [enabled
  by default] list.h: In constructor ‘ListNode::ListNode(T, const
  ListNode&amp;) [with T = int]’: list.cpp:12:33:   instantiated from
  here list.h:15:76: error: cannot convert ‘const ListNode’ to
  ‘ListNode</em>’ in initialization</p>
</blockquote>
