title: std::map<string, class> print the value of the key
body: <p>My program is written in C++.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;map&gt;
  
  using namespace std;
  
  
      class Details
      {
          int x;
          int y;
      };
  
      typedef std::map&lt;string, Details&gt; Det;
      Det det;
  
      Details::Details(int p, int c) {
          x = p;
          y = c;
      }
  
      int main(){
  
          det.clear();
  
          insertNew("test", 1, 2);
  
          cout &lt;&lt; det["test"] &lt;&lt; endl;
  
          return 0;
      }
  </code></pre>
  
  <p>I want to print the value of a key with the simplest way. Eg det["test"] fails to compile.
  How to I print values (1,2) for (x,y) that correspond to key "test"?</p>