title: error C2678: binary '=' : no operator found which takes a left-hand operand of type 'const Recipe' (or there is no acceptable conversion)
body: <p>I'm trying to sort a vector that contains an int and a string in each element. It is a vector of class type called vector recipes. Getting the above error, here's my code:</p>
  
  <p>In my Recipe.h file</p>
  
  <pre><code>struct Recipe {
  public:
      string get_cname() const
      {
          return chef_name;
      }
  private:
      int recipe_id;
      string chef_name;
  </code></pre>
  
  <p>In my Menu.cpp file</p>
  
  <pre><code>void Menu::show() const {
      sort(recipes.begin(), recipes.end(), Sort_by_cname());
  }
  </code></pre>
  
  <p>In my Menu.h file</p>
  
  <pre><code>#include &lt;vector&gt;
  #include "Recipe.h"
  using namespace std;
  
  struct Sort_by_cname 
  {
      bool operator()(const Recipe&amp; a, const Recipe&amp; b)
      {
          return a.get_cname() &lt; b.get_cname();
      }
  };
  
  class Menu {
  public: 
      void show() const;
  private
      vector&lt;Recipe&gt; recipes;
  };
  </code></pre>
  
  <p>What am I doing wrong?</p>