title: How to create a map with key and value as structs in C++?
body: <p>I'm trying to create a map whose key and value are both structs (stE and stR), so I have something like this:</p>
  
  <pre><code> struct stR{
    char* est;
    char* et;     
   };
  
  struct stE{
        int num;
        char* form; 
        char* et; 
        map&lt;stE,stR&gt; s; 
  }; 
  </code></pre>
  
  <p>But when I want to insert a new element:</p>
  
  <pre><code>stE e;
  e.num=1;
  e.form="a";
  e.et="b";
  
  stE f;
  f.num=2;
  f.form="c";
  f.et="d";
  
  stR r;
  r.est="e";
  r.et="";
  
  e.s.insert(make_pair(f, r));
  </code></pre>
  
  <p>It gives me an error:</p>
  
  <blockquote>
    <p>C:\Dev-Cpp\include\c++\3.4.2\bits\stl_function.h In member function `bool std::less&lt;_Tp>::operator()(const _Tp&amp;, const _Tp&amp;) const [with _Tp = stEstado]': </p>
  </blockquote>
  
  <p>I can't find what's the problem. Could anyone help me?
  Thanks in advance.</p>