STDCXX-1017
* doc/stdlibref/bind1st.html (Description): Corrected confusing
text.
Updated code snippet to use the standard three-argument count_if()
algorithm instead of the obsolete four-argument extension.
Modified:
stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html
Modified: stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html?rev=699389&r1=699388&r2=699389&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html (original)
+++ stdcxx/branches/4.2.x/doc/stdlibref/bind1st.html Fri Sep 26 09:09:19 2008
@@ -64,14 +64,13 @@
### Description

Because so many functions included in the C++ Standard Library take other functions as arguments, the library includes classes that let you build new function objects out of old ones. Both `bind1st()` and `bind2nd()` are functions that take as arguments a binary function object `f` and a value `x,` and return, respectively, classes *binder1st* and *binder2nd*. The underlying function object must be a subclass of *binary_function*.

Class *binder1st* binds the value to the first argument of the binary function, and *binder2nd* does the same thing for the second argument of the function. The resulting classes can be used in place of a unary predicate in other function calls.

-For example, you could use the `count_if()` algorithm to count all elements in a *vector* that are less than or equal to 7, using the following:

+For example, you could use the `count_if()` algorithm to count all elements in a *vector* that are less than 7, using the following:

-vector<int> v;

int littleNums;

-count_if(v.begin, v.end, bind1st(greater<int>(),7),
- littleNums)
+std::vector<int> v (/* ... */);
+int littleNums = std::count_if (v.begin (), v.end (), std::bind1st (std::less<int>(), 7));

-This function adds one to `littleNums` each time the element is greater than 7.

+The function counts the number of elements in the range [`v.begin()`, `v.end()`) as denoted by the first two iterator arguments that satisfy the predicate specified by the third argument and returns the result.

### Interface

namespace std {