title: error : expected primary expression before '.' token
body: <p>I want to sort structure in C++ . Here is my struct . </p>
  
  <pre><code>struct Route
  {
      string name;
      int cond;
      double value;
  
  }Route_cal[400];
  </code></pre>
  
  <p>My comparator function is as follows :</p>
  
  <pre><code>bool customer_sorter(Route const&amp; lhs, Route  const&amp; rhs)
  {
      if (lhs.value != rhs.value)
          return lhs.value &lt; rhs.value;
  }
  </code></pre>
  
  <p>I want to sort the structure by the following code : </p>
  
  <pre><code>std::sort(Route.begin(),Route.end(), &amp;customer_sorter);
  </code></pre>
  
  <p>By surprisingly an error is generated . The error is as follows : </p>
  
  <pre><code>error : expected primary expression before '.' token
  </code></pre>
  
  <p>A snapshot of my error is as follows : </p>
  
  <p><img src="https://i.stack.imgur.com/z1w62.png" alt="enter image description here">
  Why do I have the error ? Can you please help me in this purpose ? </p>