title: Error: no viable overloaded operator[]
body: <p>This is a bit of my code:</p>
  
  <pre><code>#include "pugi/pugixml.hpp"
  
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;map&gt;
  int main() {
      pugi::xml_document doca, docb;
      std::map&lt;std::string, pugi::xml_node&gt; mapa, mapb;
  
      if (!doca.load_file("a.xml") || !docb.load_file("b.xml"))
          return 1;
  
      for (auto&amp; node: doca.child("site_entries").children("entry")) {
          const char* id = node.child_value("id");
          mapa[new std::string(id, strlen(id))] = node;
      }
  
      for (auto&amp; node: docb.child("site_entries").children("entry"))
          const char* idcs = node.child_value("id");
          std::string id = new std::string(idcs, strlen(idcs));
          if (!mapa.erase(id)) {
              mapb[id] = node;
          }
      }
  </code></pre>
  
  <p>When compiling I get this error: </p>
  
  <pre><code>src/main.cpp:16:13: error: no viable overloaded operator[] for type 'std::map&lt;std::string, pugi::xml_node&gt;'
          mapa[new std::string(id, strlen(id))] = node;
  </code></pre>