title: Unable to define a list of variable type and size using template arguments
body: <p>I have a list as a private member of a class that has two template arguments: <code>type</code> for the data type of the list elements and <code>size</code> for the number of elements in the list. To this end, I want to use the list's fill constructor using my two template arguments. Here is my attempt:</p>
  
  <pre><code>#include &lt;list&gt;
  
  template &lt;typename type, unsigned int size&gt;
  class my_class {
  
     private:
        std::list&lt;type&gt; my_queue(size, 0);
  
     // More code here...
  
  };
  </code></pre>
  
  <p>My approach seems to follow the information and example provided <a href="http://www.cplusplus.com/reference/list/list/list/" rel="nofollow">here</a>; but when I compile this, I get the following error.</p>
  
  <pre><code>error: 'size' is not a type
  error: expected identifier before numeric constant
  error: expected ',' or '...' before numeric constant
  </code></pre>
  
  <p>It seems as though it recognizes the declaration of the list by its default constructor instead of the fill constructor. Can anyone help me solve this?</p>
  
  <p>Thank you!</p>
  
  <p><strong>Edit:</strong> here is my revised source with more detail. I am now having trouble with the public method. <em>Note:</em> this is my class's header file.</p>
  
  <pre><code>#include &lt;list&gt;
  
  template &lt;typename T, unsigned int N&gt;
  class my_class {
  
     private:
  
        std::list&lt;T&gt; my_queue;
  
     public:
  
        // Constructor
        my_class() : my_queue(N, 0) { }
  
        // Method
        T some_function(T some_input);
        // The source for this function exists in another file.
  
  };
  </code></pre>
  
  <p><strong>Edit 2:</strong> Final implementation... thank you, @billz!</p>
  
  <pre><code>#include &lt;list&gt;
  
  template &lt;typename T, unsigned int N&gt;
  class my_class {
  
     private:
  
        std::list&lt;T&gt; my_queue;
  
     public:
  
        // Constructor
        my_class() : my_queue(N, 0) { }
  
        // Method
        T some_function(T some_input){
           // Code here, which accesses my_queue
        }
  
  };
  </code></pre>