title: Using functors with STL algorithms versus lambda expressions?
body: <p>Stroustrup gives the example of using an overloaded <code>operator()</code> to execute a function on vector elements during a transform operation:</p>
  
  <pre><code>class Example
  {
    public:
     std::vector&lt;int&gt; Test1 {1,2,3,4,5};
     std::vector&lt;int&gt; Test2;
     int operator()(int el);
     void MyFunction();
  }
  
  int Example::operator()(int el)
  {
    return el + 1;
  }
  
  void Example::MyFunction()
  {
  std::transform(Test1.begin(), Test1.end(), std::back_inserter(Test2), std::bind(Example(), std::placeholders::_1))
  }
  </code></pre>
  
  <p>However, with the introduction of lambda expressions the above code seems very verbose, compared to:</p>
  
  <pre><code>std::transform(Test1.begin(), Test1.end(), std::back_inserter(Test2), [](int el){return el + 1;});
  </code></pre>
  
  <p>Am I right in saying there is little value in using the overloaded <code>operator()</code> approach? Or are there still scenarios where they can be beneficial when working with STL algorithms?</p>