title: No viable conversion from 'mapped_type'
body: <p>This is my code to compare XML files, using a map to define xml tag names to content.</p>
  
  <pre><code>#include "pugi/pugixml.hpp"
  
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;map&gt;
  
  using namespace std;
  
  int main()
  {
      pugi::xml_document doca, docb;
      std::map&lt;std::string, pugi::xml_node&gt; mapa, mapb;
      std::map&lt;int, std::string&gt; tagMap {make_pair(1, "data"), make_pair(2, "entry"), make_pair(3, "id"), make_pair(4, "content")};
  
      if (!doca.load_file("a.xml") || !docb.load_file("b.xml")) {
          std::cout &lt;&lt; "Can't find input files";
          return 1;
      }
  
      for (auto&amp; node: doca.child(tagMap[1]).children(tagMap[2])) {
          auto id = node.child_value(tagMap[3]);
          mapa[id] = node;
      }
  
      for (auto&amp; node: docb.child(tagMap[1]).children(tagMap[2])) {
          auto idcs = node.child_value(tagMap[3]);
          if (!mapa.erase(idcs)) {
              mapb[idcs] = node;
          }
      }
  }
  </code></pre>
  
  <p>The error I get is this:</p>
  
  <pre><code>src/main.cpp:20:30: error: no viable conversion from 'mapped_type' (aka 'std::__1::basic_string&lt;char&gt;') to
        'const char_t *' (aka 'const char *')
          for (auto&amp; node: doca.child(tagMap[1]).children(tagMap[2])) {
                                      ^~~~~~~~~
  </code></pre>
  
  <p>On recommendation I tried this approach:</p>
  
  <pre><code>        auto id = node.child_value(tagMap[3].c_str());
  </code></pre>
  
  <p>But I still get same error. It seems me trying to use a map to define the tag names has caused a lot of issues over just hardcoding it, but mapping it seems logical since in the future I will move the map to an external file so I can run the program for different XML tags without recompiling each time.</p>