title: C++ Sorting Custom Objects in a list
body: <p>I am having trouble sorting a list of custom class pointers. The class I need to sort are events. These get assigned a random time and I need to do them in the right order. </p>
  
  <pre><code>#include &lt;list&gt;
  
  Class Event{
  public: 
  float time; // the value which I need to sort them by
  int type; // to indicate which event i'm dealing with
  
  Event(float tempTime, int tempType)
  {
      time = tempTime;
      type = tempType; 
  }
  
  
  int main(){
  
  std::list&lt;Event*&gt; EventList;
  list&lt;Event*&gt;::iterator it;
  
  .........
  </code></pre>
  
  <p>If you could help me sort this out it would be much appreciated! I've been stuck on this for hours now. </p>
  
  <p>Thanks! </p>