Standard C++ Library Class Reference

Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
less
Function Object
Summary
Binary function object that returns true if its first argument is less than its second
Contents
Synopsis
Description
Interface
Warning
See Also
Synopsis
#include<functional>
template <class T>
struct less : public binary_function<T, T, bool> ;
Description
less is a binary function object. Its operator() returns true if x is less than y. You can pass a less object
to any algorithm that requires a binary function. For example, the transform algorithm applies a binary
operation to corresponding values in two collections and stores the result of the function. less would be
used in that algorithm in the following manner:
vector<int> vec1;
vector<int> vec2;
vector<int> vecResult;
.
.
.