title: Passing custom class object as a value into STL map
body: <p>I want to pass object of a custom class as a value into STL map. How do I do that..?</p>
  
  <p>here is a code:</p>
  
  <pre><code>class demo
  {
  
  int a, b,c,d,e;
  
  }
  
  // here is how declare my map:
  
  map&lt;int, demo*&gt; my_map;
  </code></pre>
  
  <p>This is how, I am using it into function:</p>
  
  <pre><code>demo *ptr = NULL;
  ptr = new demo;
  </code></pre>
  
  <p>Here is how I am inserting into map</p>
  
  <pre><code>my_map.insert(make_pair(int, ptr);
  
  // Delete current instance
  
  delete ptr;
  </code></pre>
  
  <p>Is this a correct way..? </p>