2 / Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
3 / Copyright (c) 2003-2005 Peter Dimov
5 / Distributed under the Boost Software License, Version 1.0. (See
6 / accompanying file LICENSE_1_0.txt or copy at
7 / http://www.boost.org/LICENSE_1_0.txt)
10 [section:interface Interface]
12 [section:synopsys Synopsis]
16 template<class T> T * ``[link get_pointer_1 `get_pointer`]``(T * p);
18 template<class R, class T> ``/unspecified-1/`` ``[link mem_fn_1 `mem_fn`]``(R (T::*pmf) ());
20 template<class R, class T> ``/unspecified-2/`` ``[link mem_fn_2 `mem_fn`]``(R (T::*pmf) () const);
22 template<class R, class T> ``/unspecified-2-1/`` ``[link mem_fn_2_1 `mem_fn`]``(R T::*pm);
24 template<class R, class T, class A1> ``/unspecified-3/`` ``[link mem_fn_3 `mem_fn`]``(R (T::*pmf) (A1));
26 template<class R, class T, class A1> ``/unspecified-4/`` ``[link mem_fn_4 `mem_fn`]``(R (T::*pmf) (A1) const);
28 template<class R, class T, class A1, class A2> ``/unspecified-5/`` ``[link mem_fn_5 `mem_fn`]``(R (T::*pmf) (A1, A2));
30 template<class R, class T, class A1, class A2> ``/unspecified-6/`` ``[link mem_fn_6 `mem_fn`]``(R (T::*pmf) (A1, A2) const);
32 // implementation defined number of additional overloads for more arguments
37 [section Common requirements]
39 All /unspecified-N/ types mentioned in the Synopsis are /CopyConstructible/
40 and /Assignable/. Their copy constructors and assignment operators do not
41 throw exceptions. /unspecified-N/`::result_type` is defined as the return type
42 of the member function pointer passed as an argument to `mem_fn` (`R` in the
43 Synopsis.) /unspecified-2-1/`::result_type` is defined as `R`.
47 [section `get_pointer`]
51 template<class T> T * get_pointer(T * p)
63 template<class R, class T> ``/unspecified-1/`` mem_fn(R (T::*pmf) ())
65 * /Returns:/ a function object \u03DD such that the expression \u03DD`(t)` is
66 equivalent to `(t.*pmf)()` when `t` is an l-value of type `T` or derived,
67 `(get_pointer(t)->*pmf)()` otherwise.
73 template<class R, class T> ``/unspecified-2/`` mem_fn(R (T::*pmf) () const)
75 * /Returns:/ a function object \u03DD such that the expression \u03DD`(t)` is
76 equivalent to `(t.*pmf)()` when `t` is of type `T` /[/`const`/]/ or derived,
77 `(get_pointer(t)->*pmf)()` otherwise.
83 template<class R, class T> ``/unspecified-2-1/`` mem_fn(R T::*pm)
85 * /Returns:/ a function object \u03DD such that the expression \u03DD`(t)` is
86 equivalent to `t.*pm` when `t` is of type `T` /[/`const`/]/ or derived,
87 `get_pointer(t)->*pm` otherwise.
93 template<class R, class T, class A1> ``/unspecified-3/`` mem_fn(R (T::*pmf) (A1))
95 * /Returns:/ a function object \u03DD such that the expression \u03DD`(t, a1)`
96 is equivalent to `(t.*pmf)(a1)` when `t` is an l-value of type `T` or derived,
97 `(get_pointer(t)->*pmf)(a1)` otherwise.
103 template<class R, class T, class A1> ``/unspecified-4/`` mem_fn(R (T::*pmf) (A1) const)
105 * /Returns:/ a function object \u03DD such that the expression \u03DD`(t, a1)`
106 is equivalent to `(t.*pmf)(a1)` when `t` is of type `T` /[/`const`/]/ or derived,
107 `(get_pointer(t)->*pmf)(a1)` otherwise.
113 template<class R, class T, class A1, class A2> ``/unspecified-5/`` mem_fn(R (T::*pmf) (A1, A2))
115 * /Returns:/ a function object \u03DD such that the expression \u03DD`(t, a1, a2)`
116 is equivalent to `(t.*pmf)(a1, a2)` when `t` is an l-value of type `T` or derived,
117 `(get_pointer(t)->*pmf)(a1, a2)` otherwise.
123 template<class R, class T, class A1, class A2> ``/unspecified-6/`` mem_fn(R (T::*pmf) (A1, A2) const)
125 * /Returns:/ a function object \u03DD such that the expression \u03DD`(t, a1, a2)`
126 is equivalent to `(t.*pmf)(a1, a2)` when `t` is of type `T` /[/`const`/]/ or derived,
127 `(get_pointer(t)->*pmf)(a1, a2)` otherwise.