title: Why does the C++ map type argument require an empty constructor when using []?
body: <blockquote>
    <p>See also
    <a href="https://stackoverflow.com/questions/695372/c-standard-list-and-default-constructible-types">C++ standard list and default-constructible types</a></p>
  </blockquote>
  
  <p>Not a major issue, just annoying as I don't want my class to ever be instantiated without the particular arguments.</p>
  
  <pre><code>#include &lt;map&gt;
  
  struct MyClass
  {
      MyClass(int t);
  };
  
  int main() {
      std::map&lt;int, MyClass&gt; myMap;
      myMap[14] = MyClass(42);
  }
  </code></pre>
  
  <p>This gives me the following g++ error:</p>
  
  <blockquote>
    <p>/usr/include/c++/4.3/bits/stl_map.h:419: error: no matching function for call to ‘MyClass()’</p>
  </blockquote>
  
  <p>This compiles fine if I add a default constructor; I am certain it's not caused by incorrect syntax.</p>