title: struct comparator constructor vs operator () in c++
body: <p>I have this code:</p>
  <pre><code>struct PointComparator
  {
     explicit PointComparator(const Point&amp; lowest)
        : m_lowest(lowest)
     {}
     
     bool operator()(const Point&amp; a, const Point&amp; b)
     {
        std::cout &lt;&lt; m_lowest[0] &lt;&lt; std::endl;
        return; // TODO
     }
  
  private:
     Point m_lowest;
  };
  
  // in another function:
  Point lowestPoint;  // (get this from somewhere)
  std::sort(points.begin(), points.end(), PointComparator(lowestPoint));
  </code></pre>
  <p>I'm just confused on the explicit keyword. When I do a normal sort, I would call something like <code>sort(sort(points.begin(), points.end(), compar())</code>, and compar() points to the <code>bool operator()(const Point&amp; a, const Point&amp; b)</code> function, but now <code>PointComparator(lowestPoint)</code> refers to the constructor so how does it still work?</p>