title: C++ initialize an empty list in class
body: <p>How can I initialize an empty list as a private member in a C++ class? I don't want to prompt the user to pass in an empty list, but rather just create one when I make a new instance of the class.</p>
  
  <p>header.h</p>
  
  <pre><code>class MyClass{
  public:
      MyClass();
  private:
      list&lt;int&gt; myList;
  }
  </code></pre>
  
  <p>MyClass.cpp</p>
  
  <pre><code>MyClass::MyClass()
      :myList(list&lt;int&gt;){}
  </code></pre>
  
  <p>This doesn't work as written, what am I missing here?</p>