title: How to use a struct in std::map?
body: <p>I have a complex struct i want to put as a key of the std::map to make a list of all unique objects fast:</p>
  
  <pre><code>union somecomplexstruct {
       struct {
          more_structs val1, val2;
          even_more_structs val3, val4;
          lots_of_more_structs val5;
       };
       unsigned int DATA[3];
  };
  
  typedef map&lt;somecomplexstruct, int, greater&lt;somecomplexstruct&gt; &gt; somecomplexstructMap;
  </code></pre>
  
  <p>But it says error: <code>error C2784: 'bool std::operator &gt;(const std::vector&lt;_Ty,_Alloc&gt; &amp;,const std::vector&lt;_Ty,_Alloc&gt; &amp;)' : could not deduce template argument for 'const std::vector&lt;_Ty,_Alloc&gt; &amp;' from 'const somecomplexstruct'</code></p>
  
  <p>How do i make my struct work there?</p>
  
  <p><strong>Edit:</strong> Got it working, thanks to everyone! Heres the code:</p>
  
  <pre><code>inline bool operator&gt;(const somecomplexstruct &amp;v1, const somecomplexstruct &amp;v2){
      if(v1.DATA[0] &gt; v2.DATA[0]) return 1;
      if(v1.DATA[0] &lt; v2.DATA[0]) return 0;
      if(v1.DATA[1] &gt; v2.DATA[1]) return 1;
      if(v1.DATA[1] &lt; v2.DATA[1]) return 0;
      return v1.DATA[2] &gt; v2.DATA[2];
  }
  </code></pre>