From 424480e55b2c769d47284d48a7620d737297579e Mon Sep 17 00:00:00 2001
From: Peter Dimov
Date: Thu, 13 Jan 2005 13:49:25 +0000
Subject: [PATCH] Updated to reflect that mem_fn's result_type is now R for
data members.
[SVN r26688]
---
bind.html | 61 +++++++++++++++++++++++++++--------------------------
mem_fn.html | 10 ++++-----
2 files changed, 36 insertions(+), 35 deletions(-)
diff --git a/bind.html b/bind.html
index c3e858f..c1b5a2c 100644
--- a/bind.html
+++ b/bind.html
@@ -9,7 +9,7 @@
|
-
+ |
bind.hpp
|
@@ -192,14 +192,14 @@ bind(std::less<int>(), _1, 9)(x); // x < 9
boost::mem_fn has been used to convert the member pointer into a
function object. In other words, the expression
- bind(&X::f, args)
+ bind(&X::f, args)
is equivalent to
- bind<R>(mem_fn(&X::f), args)
+ bind<R>(mem_fn(&X::f), args)
- where R is the return type of X::f (for member functions) or a
- const reference to the type of the member (for data members.)
+
where R is the return type of X::f (for member functions) or the
+ type of the member (for data members.)
[Note: mem_fn creates function objects that are able to accept a pointer,
a reference, or a smart pointer to an object as its first argument; for
@@ -220,8 +220,8 @@ int i = 5;
bind(&X::f, ref(x), _1)(i); // x.f(i)
bind(&X::f, &x, _1)(i); //(&x)->f(i)
-bind(&X::f, x, _1)(i); // (internal copy of x).f(i)
-bind(&X::f, p, _1)(i); // (internal copy of p)->f(i)
+bind(&X::f, x, _1)(i); // (internal copy of x).f(i)
+bind(&X::f, p, _1)(i); // (internal copy of p)->f(i)
The last two examples are interesting in that they produce "self-contained"
function objects. bind(&X::f, x, _1) stores a copy of x. bind(&X::f,
@@ -436,7 +436,7 @@ int main()
int main()
{
boost::bind(&X::f, 1); // error, X::f takes two arguments
- boost::bind(&X::f, _1, 1); // OK
+ boost::bind(&X::f, _1, 1); // OK
}
The function object cannot be called with the specified
@@ -552,37 +552,37 @@ int main()
// no arguments
-template<class R, class F> unspecified-1 bind(F f);
+template<class R, class F> unspecified-1 bind(F f);
-template<class F> unspecified-1-1 bind(F f);
+template<class F> unspecified-1-1 bind(F f);
-template<class R> unspecified-2 bind(R (*f) ());
+template<class R> unspecified-2 bind(R (*f) ());
// one argument
-template<class R, class F, class A1> unspecified-3 bind(F f, A1 a1);
+template<class R, class F, class A1> unspecified-3 bind(F f, A1 a1);
-template<class F, class A1> unspecified-3-1 bind(F f, A1 a1);
+template<class F, class A1> unspecified-3-1 bind(F f, A1 a1);
-template<class R, class B1, class A1> unspecified-4 bind(R (*f) (B1), A1 a1);
+template<class R, class B1, class A1> unspecified-4 bind(R (*f) (B1), A1 a1);
-template<class R, class T, class A1> unspecified-5 bind(R (T::*f) (), A1 a1);
+template<class R, class T, class A1> unspecified-5 bind(R (T::*f) (), A1 a1);
-template<class R, class T, class A1> unspecified-6 bind(R (T::*f) () const, A1 a1);
+template<class R, class T, class A1> unspecified-6 bind(R (T::*f) () const, A1 a1);
-template<class R, class T, class A1> unspecified-6-1 bind(R T::*f, A1 a1);
+template<class R, class T, class A1> unspecified-6-1 bind(R T::*f, A1 a1);
// two arguments
-template<class R, class F, class A1, class A2> unspecified-7 bind(F f, A1 a1, A2 a2);
+template<class R, class F, class A1, class A2> unspecified-7 bind(F f, A1 a1, A2 a2);
-template<class F, class A1, class A2> unspecified-7-1 bind(F f, A1 a1, A2 a2);
+template<class F, class A1, class A2> unspecified-7-1 bind(F f, A1 a1, A2 a2);
-template<class R, class B1, class B2, class A1, class A2> unspecified-8 bind(R (*f) (B1, B2), A1 a1, A2 a2);
+template<class R, class B1, class B2, class A1, class A2> unspecified-8 bind(R (*f) (B1, B2), A1 a1, A2 a2);
-template<class R, class T, class B1, class A1, class A2> unspecified-9 bind(R (T::*f) (B1), A1 a1, A2 a2);
+template<class R, class T, class B1, class A1, class A2> unspecified-9 bind(R (T::*f) (B1), A1 a1, A2 a2);
-template<class R, class T, class B1, class A1, class A2> unspecified-10 bind(R (T::*f) (B1) const, A1 a1, A2 a2);
+template<class R, class T, class B1, class A1, class A2> unspecified-10 bind(R (T::*f) (B1) const, A1 a1, A2 a2);
// implementation defined number of additional overloads for more arguments
@@ -591,11 +591,11 @@ template<class R, class T, class B1, class A1, class A2> unspecified-10
namespace
{
-unspecified-placeholder-type-1 _1;
+unspecified-placeholder-type-1 _1;
-unspecified-placeholder-type-2 _2;
+unspecified-placeholder-type-2 _2;
-unspecified-placeholder-type-3 _3;
+unspecified-placeholder-type-3 _3;
// implementation defined number of additional placeholder definitions
@@ -784,11 +784,11 @@ namespace
@@ -826,8 +826,9 @@ namespace
The Binder Library
by Jaakko Järvi;
- The Lambda Library (now part of Boost)
- by Jaakko Järvi and Gary Powell (the successor to the Binder Library);
+ The Lambda Library
+ (now part of Boost) by Jaakko Järvi and Gary Powell (the successor to the
+ Binder Library);
Extensions to the
STL by Petter Urkedal.
diff --git a/mem_fn.html b/mem_fn.html
index a547189..2d0da3c 100644
--- a/mem_fn.html
+++ b/mem_fn.html
@@ -10,7 +10,7 @@
|
-
+ |
mem_fn.hpp
|
@@ -139,7 +139,7 @@ void k(std::vector<boost::shared_ptr<X> > const & v)
All function objects returned by mem_fn expose a result_type typedef
that represents the return type of the member function. For data members, result_type
- is defined as a const reference to the type of the member.
+ is defined as the type of the member.
- libs/bind/test/mem_fn_void_test.cpp (test for
- void returns)
+ libs/bind/test/mem_fn_void_test.cpp (test
+ for void returns)
Dependencies