Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

18.4. Function Objects

Many algorithms operate on sequences using iterators and values only. For example, we can find() the first element with the value 7 in a sequence like this:

void f(list<int>& c)
{
       list<int>::iterator p = find (c.begin(), c.end(),7);
       // ...
}


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial