title: Using parallel_sort algorithm on a struct
body: <p>How to use <a href="http://software.intel.com/sites/products/documentation/doclib/tbb_sa/help/reference/algorithms/parallel_sort_func.htm" rel="nofollow">parallel_sort</a> with this struct:</p>
  
  <pre><code>struct d
  {
      char name[5];
  };
  
  struct less_than_key
  {
      inline bool operator() (const d&amp; struct1, const d&amp; struct2) const
      {
          return strcmp(struct1.name, struct2.name) == -1;
      }
  };
  
  vector&lt;d&gt; my_d;
  my_d.resize(3);
  
  strcpy(my_d[0].name, "mike");
  strcpy(my_d[1].name, "joe");
  strcpy(my_d[2].name, "anna");
  
  parallel_sort(my_d.begin(), my_d.end(), less_than_key());
  </code></pre>
  
  <p><strong>DONE!</strong>, I hope this helps someone else.</p>
  
  <p>Guess it's time to take my Phd in sorting algorithms!</p>