Compare commits

..

1 Commits

Author SHA1 Message Date
nobody
53203e2f26 This commit was manufactured by cvs2svn to create tag
'Version_1_26_0'.

[SVN r11842]
2001-11-30 18:24:42 +00:00
16 changed files with 282 additions and 891 deletions

291
bind.html
View File

@@ -38,25 +38,15 @@
<h3 style="margin-left: 20pt;"><a href="#Limitations">Limitations</a></h3>
<h3 style="margin-left: 20pt;"><a href="#FAQ">Frequently Asked Questions</a></h3>
<h4 style="margin-left: 40pt;"><a href="#Q_doesnt_compile">Why doesn't this compile?</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q_does_compile">Why does this compile? It should not.</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q_forms">What is the difference between bind(f, ...) and bind&lt;R&gt;(f, ...)?</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q_win32_api">Does <b>bind</b> work with Windows API functions?</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q_com">Does <b>bind</b> work with COM methods?</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q_mac">Does <b>bind</b> work with Mac toolbox functions?</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q_auto_stdcall">Why doesn't <b>bind</b> automatically recognize nonstandard functions?</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q1">Why doesn't this compile?</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q2">Why does this compile? It should not.</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q3">What is the difference between bind(f, ...) and bind&lt;R&gt;(f, ...)?</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q4">Does <b>bind</b> work with Windows API functions?</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q5">Does <b>bind</b> work with COM methods?</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q6">Does <b>bind</b> work with Mac toolbox functions?</a></h4>
<h4 style="margin-left: 40pt;"><a href="#Q7">Why doesn't <b>bind</b> automatically recognize nonstandard functions?</a></h4>
<h3 style="margin-left: 20pt;"><a href="#Troubleshooting">Troubleshooting</a></h3>
<h4 style="margin-left: 40pt;"><a href="#err_num_args">Incorrect number of arguments</a></h4>
<h4 style="margin-left: 40pt;"><a href="#err_signature">The function object cannot be called with the specified arguments</a></h4>
<h4 style="margin-left: 40pt;"><a href="#err_arg_access">Accessing an argument that does not exist</a></h4>
<h4 style="margin-left: 40pt;"><a href="#err_short_form">Inappropriate use of bind(f, ...)</a></h4>
<h4 style="margin-left: 40pt;"><a href="#err_long_form">Inappropriate use of bind&lt;R&gt;(f, ...)</a></h4>
<h4 style="margin-left: 40pt;"><a href="#err_nonstd">Binding a nonstandard function</a></h4>
<h4 style="margin-left: 40pt;"><a href="#err_const_arg"><b>const</b> in signatures</a></h4>
<h4 style="margin-left: 40pt;"><a href="#err_msvc_using">MSVC specific: using boost::bind;</a></h4>
<h4 style="margin-left: 40pt;"><a href="#err_msvc_class_template">MSVC specific: class templates shadow function templates</a></h4>
<h4 style="margin-left: 40pt;"><a href="#err_msvc_ellipsis">MSVC specific: ... in signatures treated as type</a></h4>
<h3 style="margin-left: 20pt;"><a href="#Interface">Interface</a></h3>
<h4 style="margin-left: 40pt;"><a href="#Synopsis">Synopsis</a></h4>
@@ -69,7 +59,7 @@
<h4 style="margin-left: 40pt;"><a href="#Dependencies">Dependencies</a></h4>
<h4 style="margin-left: 40pt;"><a href="#NumberOfArguments">Number of Arguments</a></h4>
<h4 style="margin-left: 40pt;"><a href="#stdcall">&quot;__stdcall&quot; and &quot;pascal&quot; Support</a></h4>
<h4 style="margin-left: 40pt;"><a href="#BOOST_BIND">Using the BOOST_BIND macro</a></h4>
<h4 style="margin-left: 40pt;"><a href="#MSVC">MSVC specific problems and workarounds</a></h4>
<h4 style="margin-left: 40pt;"><a href="#visit_each"><b>visit_each</b> support</a></h4>
<h3 style="margin-left: 20pt;"><a href="#Acknowledgements">Acknowledgements</a></h3>
@@ -121,15 +111,15 @@ library primitives:
</p>
<pre>
std::bind2nd(std::ptr_fun(f), 5)(x);
std::bind1st(std::ptr_fun(f), 5)(x);
</pre>
<p>
<b>bind</b> covers the functionality of <b>std::bind1st</b> as well:
<b>bind</b> covers the functionality of <b>std::bind2nd</b> as well:
</p>
<pre>
std::bind1st(std::ptr_fun(f), 5)(x); // f(5, x)
std::bind2nd(std::ptr_fun(f), 5)(x); // f(5, x)
bind(f, 5, _1)(x); // f(5, x)
</pre>
@@ -211,7 +201,7 @@ the explicit return type can be omitted:
<pre>
int x = 8;
bind(std::less&lt;int&gt;(), _1, 9)(x); // x < 9
bind(std::less&lt;int&gt;, _1, 9)(x); // x < 9
</pre>
<p>
@@ -268,7 +258,7 @@ int i = 5;
bind(&amp;X::f, ref(x), _1)(i); // x.f(i)
bind(&amp;X::f, &amp;x, _1)(i); // (&amp;x)->f(i)
bind(&amp;X::f, &x, _1)(i); // (&x)->f(i)
bind(&amp;X::f, x, _1)(i); // (<i>internal copy of x</i>).f(i)
@@ -439,13 +429,13 @@ corresponding issue</a> has not been resolved yet.]
<h2><a name="FAQ">Frequently Asked Questions</a></h2>
<h3><a name="Q_doesnt_compile">Why doesn't this compile?</a></h3>
<h3><a name="Q1">Why doesn't this compile?</a></h3>
<p>
See the <a href="#Troubleshooting">dedicated Troubleshooting section</a>.
</p>
<h3><a name="Q_does_compile">Why does this compile? It should not.</a></h3>
<h3><a name="Q2">Why does this compile? It should not.</a></h3>
<p>
Probably because you used the general bind&lt;R&gt;(f, ...) syntax, thereby
@@ -453,7 +443,7 @@ instructing <b>bind</b> to not &quot;inspect&quot; <b>f</b> to detect arity
and return type errors.
</p>
<h3><a name="Q_forms">What is the difference between bind(f, ...) and bind&lt;R&gt;(f, ...)?</a></h3>
<h3><a name="Q3">What is the difference between bind(f, ...) and bind&lt;R&gt;(f, ...)?</a></h3>
<p>
The first form instructs <b>bind</b> to inspect the type of <b>f</b> in order
@@ -481,7 +471,7 @@ first form when <b>f</b> is a function object, and in most cases will not handle
the second form when <b>f</b> is a function (pointer) or a member function pointer.
</p>
<h3><a name="Q_win32_api">Does <b>bind</b> work with Windows API functions?</a></h3>
<h3><a name="Q4">Does <b>bind</b> work with Windows API functions?</a></h3>
<p>
Yes, if you <a href="#stdcall">#define BOOST_BIND_ENABLE_STDCALL</a>.
@@ -490,13 +480,13 @@ An alternative is to treat the function as a
bind&lt;R&gt;(f, ...) syntax.
</p>
<h3><a name="Q_com">Does <b>bind</b> work with COM methods?</a></h3>
<h3><a name="Q5">Does <b>bind</b> work with COM methods?</a></h3>
<p>
Yes, if you <a href="#stdcall">#define BOOST_MEM_FN_ENABLE_STDCALL</a>.
</p>
<h3><a name="Q_mac">Does <b>bind</b> work with Mac toolbox functions?</a></h3>
<h3><a name="Q6">Does <b>bind</b> work with Mac toolbox functions?</a></h3>
<p>
Yes, if you <a href="#stdcall">#define BOOST_BIND_ENABLE_PASCAL</a>.
@@ -505,7 +495,7 @@ An alternative is to treat the function as a
bind&lt;R&gt;(f, ...) syntax.
</p>
<h3><a name="Q_auto_stdcall">Why doesn't <b>bind</b> automatically recognize nonstandard functions?</a></h3>
<h3><a name="Q7">Why doesn't <b>bind</b> automatically recognize nonstandard functions?</a></h3>
<p>
Non-portable extensions, in general, should default to off to prevent vendor
@@ -519,210 +509,10 @@ separate support would be necessary.
<h2><a name="Troubleshooting">Troubleshooting</a></h2>
<h3><a name="err_num_args">Incorrect number of arguments</a></h3>
<p>
In a bind(f, a1, a2, ..., aN) expression, the function object <b>f</b> must
be able to take exactly <b>N</b> arguments. This error is normally detected
at &quot;bind time&quot;; in other words, the compilation error is reported
on the line where bind() is invoked:
This section is still under development.
</p>
<pre>
int f(int, int);
int main()
{
boost::bind(f, 1); // error, f takes two arguments
boost::bind(f, 1, 2); // OK
}
</pre>
<p>
A common variation of this error is to forget that member functions have an
implicit &quot;this&quot; argument:
</p>
<pre>
struct X
{
int f(int);
}
int main()
{
boost::bind(&amp;X::f, 1); // error, X::f takes two arguments
boost::bind(&amp;X::f, <b>_1</b>, 1); // OK
}
</pre>
<h3><a name="err_signature">The function object cannot be called with the specified arguments</a></h3>
<p>
As in normal function calls, the function object that is bound must be
compatible with the argument list. The incompatibility will usually be
detected by the compiler at &quot;call time&quot; and the result is
typically an error in <b>bind.hpp</b> on a line that looks like:
</p>
<pre>
return f(a[a1_], a[a2_]);
</pre>
<p>
An example of this kind of error:
</p>
<pre>
int f(int);
int main()
{
boost::bind(f, &quot;incompatible&quot;); // OK so far, no call
boost::bind(f, &quot;incompatible&quot;)(); // error, &quot;incompatible&quot; is not an int
boost::bind(f, _1); // OK
boost::bind(f, _1)(&quot;incompatible&quot;); // error, &quot;incompatible&quot; is not an int
}
</pre>
<h3><a name="err_arg_access">Accessing an argument that does not exist</a></h3>
<p>
The placeholder <b>_N</b> selects the argument at position <b>N</b> from the
argument list passed at &quot;call time.&quot; Naturally, it is an error to
attempt to access beyond the end of this list:
</p>
<pre>
int f(int);
int main()
{
boost::bind(f, _1); // OK
boost::bind(f, _1)(); // error, there is no argument number 1
}
</pre>
<p>
The error is usually reported in <b>bind.hpp</b>, at a line similar to:
</p>
<pre>
return f(a[a1_]);
</pre>
<p>
When emulating <b>std::bind1st(f, a)</b>, a common mistake of this category
is to type <b>bind(f, a, _2)</b> instead of the correct <b>bind(f, a, _1)</b>.
</p>
<h3><a name="err_short_form">Inappropriate use of bind(f, ...)</a></h3>
<p>
The bind(f, a1, a2, ..., aN) <a href="#Q_forms">form</a> causes automatic
recognition of the type of <b>f</b>. It will not work with arbitrary
function objects; <b>f</b> must be a function or a member function pointer.
</p>
<p>
It is possible to use this form with function objects that define
<b>result_type</b>, but <b>only on compilers</b> that support partial
specialization and partial ordering. In particular, MSVC up to version 7.0
does not support this syntax for function objects.
</p>
<h3><a name="err_long_form">Inappropriate use of bind&lt;R&gt;(f, ...)</a></h3>
<p>
The bind&lt;R&gt;(f, a1, a2, ..., aN) <a href="#Q_forms">form</a> supports
arbitrary function objects.
</p>
<p>
It is possible (but not recommended) to use this form with functions or
member function pointers, but <b>only on compilers</b> that support partial
ordering. In particular, MSVC up to version 7.0 does not fully support this
syntax for functions and member function pointers.
</p>
<h3><a name="err_nonstd">Binding a nonstandard function</a></h3>
<p>
(to be written)
</p>
<h3><a name="err_const_arg"><b>const</b> in signatures</a></h3>
<p>
Some compilers, including MSVC 6.0 and Borland C++ 5.5.1, have problems
with the top-level <b>const</b> in function signatures:
</p>
<pre>
int f(int const);
int main()
{
boost::bind(f, 1); // error
}
</pre>
<p>
Workaround: remove the <b>const</b> qualifier from the argument.
</p>
<h3><a name="err_msvc_using">MSVC specific: using boost::bind;</a></h3>
<p>
On MSVC (up to version 7.0), when <b>boost::bind</b> is brought into scope
with an using declaration:
</p>
<pre>
using boost::bind;
</pre>
<p>
the syntax <b>bind&lt;R&gt;(...)</b> does not work. Workaround: either use the
qualified name, <b>boost::bind</b>, or use an using directive instead:
</p>
<pre>
using namespace boost;
</pre>
<h3><a name="err_msvc_class_template">MSVC specific: class templates shadow function templates</a></h3>
<p>
On MSVC (up to version 7.0), a nested class template named <b>bind</b> will
shadow the function template <b>boost::bind</b>, breaking the
<b>bind&lt;R&gt;(...)</b> syntax. Unfortunately, some libraries contain nested
class templates named <b>bind</b> (ironically, such code is often an MSVC
specific workaround.) You may try to patch the library in question or contact
its author/maintainer. The other option is use the
<a href="#BOOST_BIND">BOOST_BIND</a> macro to rename <b>bind</b>.
</p>
<h3><a name="err_msvc_ellipsis">MSVC specific: ... in signatures treated as type</a></h3>
<p>
MSVC (up to version 7.0) treats the ellipsis in a variable argument function
(such as <b>std::printf</b>) as a type. Therefore, it will accept the
(incorrect in the current implementation) form:
</p>
<pre>
bind(printf, &quot;%s\n&quot;, _1);
</pre>
<p>
and will reject the correct version:
</p>
<pre>
bind&lt;int&gt;(printf, &quot;%s\n&quot;, _1);
</pre>
<h2><a name="Interface">Interface</a></h2>
<h3><a name="Synopsis">Synopsis</a></h3>
@@ -989,16 +779,39 @@ To use <b>bind</b> with <b>pascal</b> functions, <b>#define</b> the macro
[Note: Some compilers provide only minimal support for the <b>__stdcall</b> keyword.]
</p>
<h3><a name="BOOST_BIND">Using the BOOST_BIND macro</a></h3>
<h3><a name="MSVC">MSVC specific problems and workarounds</a></h3>
<p>
A <a href="#err_msvc_class_template">bug in MSVC (up to version 7.0)</a>
causes <b>boost::bind</b> to be incompatible
with libraries that contain nested class templates named <b>bind</b>. To work
around this problem, <b>#define</b> the macro <b>BOOST_BIND</b> to something
other than <b>bind</b> (before the inclusion of <b>&lt;boost/bind.hpp&gt;</b>)
and use this identifier throughout your code wherever you'd normally use
<b>bind</b>.
Microsoft Visual C++ (up to version 7.0) does not fully support the
<b>bind&lt;R&gt;(...)</b>
syntax required by the library when arbitrary function objects are bound.
The first problem is that when <b>boost::bind</b> is brought into scope
with an <b>using declaration</b>:
</p>
<pre>
using boost::bind;
</pre>
<p>
the syntax above does not work. Workaround: either use the qualified name,
<b>boost::bind</b>, or use an <b>using directive</b> instead:
</p>
<pre>
using namespace boost;
</pre>
<p>
The second problem is that some libraries contain nested class templates
named <b>bind</b> (ironically, such code is often an MSVC specific
workaround.) Due to some quirks with the parser, such a class template
breaks the <b>bind&lt;R&gt;(...)</b> syntax, even when the name <b>bind</b>
is fully qualified. You may try to patch the library in question or contact
its author/maintainer. The other option is to define the macro
<b>BOOST_BIND</b> to something other than <b>bind</b> (before the inclusion of
<b>&lt;boost/bind.hpp&gt;</b>) and use this identifier throughout your code
wherever you'd normally use <b>bind</b>.
</p>
<p style="color: Red;">

View File

@@ -377,6 +377,11 @@ void member_function_test()
void member_function_void_test()
{
// mem_fn void returns are temporarily disabled on MSVC 6
// they cause internal compiler errors with debug info turned on
#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200)
using namespace boost;
V v;
@@ -463,6 +468,8 @@ void member_function_void_test()
bind(&V::g8, ref(v), 1, 2, 3, 4, 5, 6, 7, 8)();
BOOST_TEST( v.hash == 23558 );
#endif
}
void nested_bind_test()

View File

@@ -8,7 +8,7 @@
//
// bind.hpp - binds function objects to arguments
//
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2001 David Abrahams
//
// Permission to copy, use, modify, sell and distribute this software
@@ -22,7 +22,6 @@
#include <boost/config.hpp>
#include <boost/ref.hpp>
#include <boost/mem_fn.hpp>
#include <boost/bind/arg.hpp>
// Borland-specific bug, visit_each() silently fails to produce code
@@ -32,11 +31,6 @@
# define BOOST_BIND_VISIT_EACH visit_each
#endif
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated
#endif
namespace boost
{
@@ -79,8 +73,13 @@ public:
private:
T t_;
value & operator= (value const &);
};
// arg
template<int I> class arg {};
// type
template<class T> class type {};
@@ -136,6 +135,9 @@ public:
#endif
private:
list0 & operator= (list0 const &);
};
template<class A1> class list1
@@ -180,6 +182,10 @@ private:
#endif
A1 a1_;
private:
list1 & operator= (list1 const &);
};
template<class A1, class A2> class list2
@@ -227,6 +233,10 @@ private:
A1 a1_;
A2 a2_;
private:
list2 & operator= (list2 const &);
};
template<class A1, class A2, class A3> class list3
@@ -277,6 +287,10 @@ private:
A1 a1_;
A2 a2_;
A3 a3_;
private:
list3 & operator= (list3 const &);
};
template<class A1, class A2, class A3, class A4> class list4
@@ -330,6 +344,10 @@ private:
A2 a2_;
A3 a3_;
A4 a4_;
private:
list4 & operator= (list4 const &);
};
template<class A1, class A2, class A3, class A4, class A5> class list5
@@ -386,6 +404,10 @@ private:
A3 a3_;
A4 a4_;
A5 a5_;
private:
list5 & operator= (list5 const &);
};
template<class A1, class A2, class A3, class A4, class A5, class A6> class list6
@@ -445,6 +467,10 @@ private:
A4 a4_;
A5 a5_;
A6 a6_;
private:
list6 & operator= (list6 const &);
};
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7
@@ -507,6 +533,10 @@ private:
A5 a5_;
A6 a6_;
A7 a7_;
private:
list7 & operator= (list7 const &);
};
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class list8
@@ -572,6 +602,10 @@ private:
A6 a6_;
A7 a7_;
A8 a8_;
private:
list8 & operator= (list8 const &);
};
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9
@@ -640,6 +674,10 @@ private:
A7 a7_;
A8 a8_;
A9 a9_;
private:
list9 & operator= (list9 const &);
};
#ifdef BOOST_NO_VOID_RETURNS
@@ -840,11 +878,14 @@ public:
#include <boost/bind/bind_template.hpp>
#undef BOOST_BIND_EVALUATE
private:
bind_t & operator= (bind_t const &);
};
#else
template<class R> struct bind_t_generator
template <class R> struct bind_t_generator
{
template<class F, class L> class implementation
@@ -857,6 +898,9 @@ public:
#include <boost/bind/bind_template.hpp>
#undef BOOST_BIND_EVALUATE
private:
implementation & operator= (implementation const &);
};
};
@@ -878,18 +922,37 @@ public:
#include <boost/bind/bind_template.hpp>
#undef BOOST_BIND_EVALUATE
private:
implementation & operator= (implementation const &);
};
};
template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
#pragma warning(push)
#pragma warning(disable: 4097) // typedef name 'base' used as a synonym for class
#endif
template<class R, class F, class L> class bind_t: public bind_t_generator<R>::BOOST_NESTED_TEMPLATE implementation<F, L>
{
private:
typedef typename bind_t_generator<R>::template implementation<F, L> base;
public:
bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
bind_t(F f, L const & l): base(f, l) {}
private:
bind_t & operator= (bind_t const &);
};
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
#pragma warning(pop)
#endif
#endif
// add_value
@@ -1297,15 +1360,17 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
} // namespace boost
#ifndef BOOST_BIND_NO_PLACEHOLDERS
# include <boost/bind/placeholders.hpp>
#endif
#ifdef BOOST_MSVC
# pragma warning(default: 4512) // assignment operator could not be generated
# pragma warning(pop)
#endif
namespace
{
boost::_bi::arg<1> _1;
boost::_bi::arg<2> _2;
boost::_bi::arg<3> _3;
boost::_bi::arg<4> _4;
boost::_bi::arg<5> _5;
boost::_bi::arg<6> _6;
boost::_bi::arg<7> _7;
boost::_bi::arg<8> _8;
boost::_bi::arg<9> _9;
}
#endif // #ifndef BOOST_BIND_HPP_INCLUDED

View File

@@ -1,30 +0,0 @@
#ifndef BOOST_BIND_ARG_HPP_INCLUDED
#define BOOST_BIND_ARG_HPP_INCLUDED
#if _MSC_VER >= 1020
#pragma once
#endif
//
// bind/arg.hpp
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
// This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
//
// See http://www.boost.org/libs/bind/bind.html for documentation.
//
namespace boost
{
template<int I> class arg
{
};
} // namespace boost
#endif // #ifndef BOOST_BIND_ARG_HPP_INCLUDED

View File

@@ -1,7 +1,7 @@
//
// bind/bind_cc.hpp - support for different calling conventions
//
// Do not include this header directly.
// Do not include this header directly.
//
// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
//

View File

@@ -1,7 +1,7 @@
//
// bind/bind_mf_cc.hpp - support for different calling conventions
//
// Do not include this header directly.
// Do not include this header directly.
//
// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
//

View File

@@ -15,7 +15,7 @@
// mf0
template<class R, class T BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf0)
template<class R, class T> class BOOST_MEM_FN_NAME(mf0)
{
public:
@@ -24,19 +24,9 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) ())
typedef R (BOOST_MEM_FN_CC T::*F) ();
F f_;
template<class U> R call(U & u, T const *) const
{
BOOST_MEM_FN_RETURN (u.*f_)();
}
template<class U> R call(U & u, void const *) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)();
}
public:
explicit BOOST_MEM_FN_NAME(mf0)(F f): f_(f) {}
@@ -48,7 +38,7 @@ public:
template<class U> R operator()(U & u) const
{
BOOST_MEM_FN_RETURN call(u, &u);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)();
}
R operator()(T & t) const
@@ -59,7 +49,7 @@ public:
// cmf0
template<class R, class T BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf0)
template<class R, class T> class BOOST_MEM_FN_NAME(cmf0)
{
public:
@@ -68,26 +58,16 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) () const)
typedef R (BOOST_MEM_FN_CC T::*F) () const;
F f_;
template<class U> R call(U & u, T const *) const
{
BOOST_MEM_FN_RETURN (u.*f_)();
}
template<class U> R call(U & u, void const *) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)();
}
public:
explicit BOOST_MEM_FN_NAME(cmf0)(F f): f_(f) {}
template<class U> R operator()(U const & u) const
{
BOOST_MEM_FN_RETURN call(u, &u);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)();
}
R operator()(T const & t) const
@@ -98,7 +78,7 @@ public:
// mf1
template<class R, class T, class A1 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf1)
template<class R, class T, class A1> class BOOST_MEM_FN_NAME(mf1)
{
public:
@@ -108,19 +88,9 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1))
typedef R (BOOST_MEM_FN_CC T::*F) (A1);
F f_;
template<class U, class B1> R call(U & u, T const *, B1 & b1) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1);
}
template<class U, class B1> R call(U & u, void const *, B1 & b1) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1);
}
public:
explicit BOOST_MEM_FN_NAME(mf1)(F f): f_(f) {}
@@ -132,7 +102,7 @@ public:
template<class U> R operator()(U & u, A1 a1) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1);
}
R operator()(T & t, A1 a1) const
@@ -143,7 +113,7 @@ public:
// cmf1
template<class R, class T, class A1 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf1)
template<class R, class T, class A1> class BOOST_MEM_FN_NAME(cmf1)
{
public:
@@ -153,26 +123,16 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1) const)
typedef R (BOOST_MEM_FN_CC T::*F) (A1) const;
F f_;
template<class U, class B1> R call(U & u, T const *, B1 & b1) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1);
}
template<class U, class B1> R call(U & u, void const *, B1 & b1) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1);
}
public:
explicit BOOST_MEM_FN_NAME(cmf1)(F f): f_(f) {}
template<class U> R operator()(U const & u, A1 a1) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1);
}
R operator()(T const & t, A1 a1) const
@@ -183,7 +143,7 @@ public:
// mf2
template<class R, class T, class A1, class A2 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf2)
template<class R, class T, class A1, class A2> class BOOST_MEM_FN_NAME(mf2)
{
public:
@@ -191,19 +151,9 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2))
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2);
F f_;
template<class U, class B1, class B2> R call(U & u, T const *, B1 & b1, B2 & b2) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2);
}
template<class U, class B1, class B2> R call(U & u, void const *, B1 & b1, B2 & b2) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2);
}
public:
explicit BOOST_MEM_FN_NAME(mf2)(F f): f_(f) {}
@@ -215,7 +165,7 @@ public:
template<class U> R operator()(U & u, A1 a1, A2 a2) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2);
}
R operator()(T & t, A1 a1, A2 a2) const
@@ -226,7 +176,7 @@ public:
// cmf2
template<class R, class T, class A1, class A2 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf2)
template<class R, class T, class A1, class A2> class BOOST_MEM_FN_NAME(cmf2)
{
public:
@@ -234,26 +184,16 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2) const)
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2) const;
F f_;
template<class U, class B1, class B2> R call(U & u, T const *, B1 & b1, B2 & b2) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2);
}
template<class U, class B1, class B2> R call(U & u, void const *, B1 & b1, B2 & b2) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2);
}
public:
explicit BOOST_MEM_FN_NAME(cmf2)(F f): f_(f) {}
template<class U> R operator()(U const & u, A1 a1, A2 a2) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2);
}
R operator()(T const & t, A1 a1, A2 a2) const
@@ -264,7 +204,7 @@ public:
// mf3
template<class R, class T, class A1, class A2, class A3 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf3)
template<class R, class T, class A1, class A2, class A3> class BOOST_MEM_FN_NAME(mf3)
{
public:
@@ -272,19 +212,9 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3))
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3);
F f_;
template<class U, class B1, class B2, class B3> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3);
}
template<class U, class B1, class B2, class B3> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3);
}
public:
explicit BOOST_MEM_FN_NAME(mf3)(F f): f_(f) {}
@@ -296,7 +226,7 @@ public:
template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2, a3);
}
R operator()(T & t, A1 a1, A2 a2, A3 a3) const
@@ -307,7 +237,7 @@ public:
// cmf3
template<class R, class T, class A1, class A2, class A3 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf3)
template<class R, class T, class A1, class A2, class A3> class BOOST_MEM_FN_NAME(cmf3)
{
public:
@@ -315,26 +245,16 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3) const)
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3) const;
F f_;
template<class U, class B1, class B2, class B3> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3);
}
template<class U, class B1, class B2, class B3> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3);
}
public:
explicit BOOST_MEM_FN_NAME(cmf3)(F f): f_(f) {}
template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2, a3);
}
R operator()(T const & t, A1 a1, A2 a2, A3 a3) const
@@ -345,7 +265,7 @@ public:
// mf4
template<class R, class T, class A1, class A2, class A3, class A4 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf4)
template<class R, class T, class A1, class A2, class A3, class A4> class BOOST_MEM_FN_NAME(mf4)
{
public:
@@ -353,19 +273,9 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4))
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4);
F f_;
template<class U, class B1, class B2, class B3, class B4> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4);
}
template<class U, class B1, class B2, class B3, class B4> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4);
}
public:
explicit BOOST_MEM_FN_NAME(mf4)(F f): f_(f) {}
@@ -377,7 +287,7 @@ public:
template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2, a3, a4);
}
R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4) const
@@ -388,7 +298,7 @@ public:
// cmf4
template<class R, class T, class A1, class A2, class A3, class A4 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf4)
template<class R, class T, class A1, class A2, class A3, class A4> class BOOST_MEM_FN_NAME(cmf4)
{
public:
@@ -396,26 +306,16 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4) const)
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4) const;
F f_;
template<class U, class B1, class B2, class B3, class B4> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4);
}
template<class U, class B1, class B2, class B3, class B4> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4);
}
public:
explicit BOOST_MEM_FN_NAME(cmf4)(F f): f_(f) {}
template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2, a3, a4);
}
R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4) const
@@ -426,7 +326,7 @@ public:
// mf5
template<class R, class T, class A1, class A2, class A3, class A4, class A5 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf5)
template<class R, class T, class A1, class A2, class A3, class A4, class A5> class BOOST_MEM_FN_NAME(mf5)
{
public:
@@ -434,19 +334,9 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5))
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5);
F f_;
template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5);
}
template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5);
}
public:
explicit BOOST_MEM_FN_NAME(mf5)(F f): f_(f) {}
@@ -458,7 +348,7 @@ public:
template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2, a3, a4, a5);
}
R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
@@ -469,7 +359,7 @@ public:
// cmf5
template<class R, class T, class A1, class A2, class A3, class A4, class A5 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf5)
template<class R, class T, class A1, class A2, class A3, class A4, class A5> class BOOST_MEM_FN_NAME(cmf5)
{
public:
@@ -477,26 +367,16 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5) const)
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5) const;
F f_;
template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5);
}
template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5);
}
public:
explicit BOOST_MEM_FN_NAME(cmf5)(F f): f_(f) {}
template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2, a3, a4, a5);
}
R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
@@ -507,7 +387,7 @@ public:
// mf6
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf6)
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> class BOOST_MEM_FN_NAME(mf6)
{
public:
@@ -515,19 +395,9 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6))
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6);
F f_;
template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6);
}
template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6);
}
public:
explicit BOOST_MEM_FN_NAME(mf6)(F f): f_(f) {}
@@ -539,7 +409,7 @@ public:
template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2, a3, a4, a5, a6);
}
R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
@@ -550,7 +420,7 @@ public:
// cmf6
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf6)
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> class BOOST_MEM_FN_NAME(cmf6)
{
public:
@@ -558,26 +428,16 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6) const)
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6) const;
F f_;
template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6);
}
template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6);
}
public:
explicit BOOST_MEM_FN_NAME(cmf6)(F f): f_(f) {}
template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2, a3, a4, a5, a6);
}
R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
@@ -588,7 +448,7 @@ public:
// mf7
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf7)
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> class BOOST_MEM_FN_NAME(mf7)
{
public:
@@ -596,19 +456,9 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7))
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7);
F f_;
template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7);
}
template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7);
}
public:
explicit BOOST_MEM_FN_NAME(mf7)(F f): f_(f) {}
@@ -620,7 +470,7 @@ public:
template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2, a3, a4, a5, a6, a7);
}
R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
@@ -631,7 +481,7 @@ public:
// cmf7
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf7)
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> class BOOST_MEM_FN_NAME(cmf7)
{
public:
@@ -639,26 +489,16 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7) const)
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7) const;
F f_;
template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7);
}
template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7);
}
public:
explicit BOOST_MEM_FN_NAME(cmf7)(F f): f_(f) {}
template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2, a3, a4, a5, a6, a7);
}
R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
@@ -669,7 +509,7 @@ public:
// mf8
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf8)
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class BOOST_MEM_FN_NAME(mf8)
{
public:
@@ -677,19 +517,9 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8))
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8);
F f_;
template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
}
template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
}
public:
explicit BOOST_MEM_FN_NAME(mf8)(F f): f_(f) {}
@@ -701,7 +531,7 @@ public:
template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
}
R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
@@ -712,7 +542,7 @@ public:
// cmf8
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf8)
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class BOOST_MEM_FN_NAME(cmf8)
{
public:
@@ -720,19 +550,9 @@ public:
private:
BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8) const)
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8) const;
F f_;
template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
{
BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
}
template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
{
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
}
public:
explicit BOOST_MEM_FN_NAME(cmf8)(F f): f_(f) {}
@@ -744,7 +564,7 @@ public:
template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
{
BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8);
BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
}
R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const

View File

@@ -13,119 +13,120 @@
// See http://www.boost.org/libs/bind/mem_fn.html for documentation.
//
template<class R, class T> struct BOOST_MEM_FN_NAME(mf0): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf0)<R, T, R (BOOST_MEM_FN_CC T::*) ()>
template<class R, class T> struct BOOST_MEM_FN_NAME(mf0): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf0)<R, T>
{
typedef R (BOOST_MEM_FN_CC T::*F) ();
explicit BOOST_MEM_FN_NAME(mf0)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf0)<R, T, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) ();
explicit BOOST_MEM_FN_NAME(mf0)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf0)<R, T>(f) {}
};
template<class R, class T> struct BOOST_MEM_FN_NAME(cmf0): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf0)<R, T, R (BOOST_MEM_FN_CC T::*) () const>
template<class R, class T> struct BOOST_MEM_FN_NAME(cmf0): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf0)<R, T>
{
typedef R (BOOST_MEM_FN_CC T::*F) () const;
explicit BOOST_MEM_FN_NAME(cmf0)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf0)<R, T, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) () const;
explicit BOOST_MEM_FN_NAME(cmf0)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf0)<R, T>(f) {}
};
template<class R, class T, class A1> struct BOOST_MEM_FN_NAME(mf1): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf1)<R, T, A1, R (BOOST_MEM_FN_CC T::*) (A1)>
template<class R, class T, class A1> struct BOOST_MEM_FN_NAME(mf1): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf1)<R, T, A1>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1);
explicit BOOST_MEM_FN_NAME(mf1)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf1)<R, T, A1, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1);
explicit BOOST_MEM_FN_NAME(mf1)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf1)<R, T, A1>(f) {}
};
template<class R, class T, class A1> struct BOOST_MEM_FN_NAME(cmf1): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf1)<R, T, A1, R (BOOST_MEM_FN_CC T::*) (A1) const>
template<class R, class T, class A1> struct BOOST_MEM_FN_NAME(cmf1): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf1)<R, T, A1>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1) const;
explicit BOOST_MEM_FN_NAME(cmf1)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf1)<R, T, A1, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1) const;
explicit BOOST_MEM_FN_NAME(cmf1)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf1)<R, T, A1>(f) {}
};
template<class R, class T, class A1, class A2> struct BOOST_MEM_FN_NAME(mf2): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf2)<R, T, A1, A2, R (BOOST_MEM_FN_CC T::*) (A1, A2)>
template<class R, class T, class A1, class A2> struct BOOST_MEM_FN_NAME(mf2): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf2)<R, T, A1, A2>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2);
explicit BOOST_MEM_FN_NAME(mf2)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf2)<R, T, A1, A2, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2);
explicit BOOST_MEM_FN_NAME(mf2)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf2)<R, T, A1, A2>(f) {}
};
template<class R, class T, class A1, class A2> struct BOOST_MEM_FN_NAME(cmf2): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf2)<R, T, A1, A2, R (BOOST_MEM_FN_CC T::*) (A1, A2) const>
template<class R, class T, class A1, class A2> struct BOOST_MEM_FN_NAME(cmf2): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf2)<R, T, A1, A2>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2) const;
explicit BOOST_MEM_FN_NAME(cmf2)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf2)<R, T, A1, A2, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2) const;
explicit BOOST_MEM_FN_NAME(cmf2)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf2)<R, T, A1, A2>(f) {}
};
template<class R, class T, class A1, class A2, class A3> struct BOOST_MEM_FN_NAME(mf3): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf3)<R, T, A1, A2, A3, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3)>
template<class R, class T, class A1, class A2, class A3> struct BOOST_MEM_FN_NAME(mf3): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf3)<R, T, A1, A2, A3>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3);
explicit BOOST_MEM_FN_NAME(mf3)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf3)<R, T, A1, A2, A3, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3);
explicit BOOST_MEM_FN_NAME(mf3)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf3)<R, T, A1, A2, A3>(f) {}
};
template<class R, class T, class A1, class A2, class A3> struct BOOST_MEM_FN_NAME(cmf3): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf3)<R, T, A1, A2, A3, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3) const>
template<class R, class T, class A1, class A2, class A3> struct BOOST_MEM_FN_NAME(cmf3): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf3)<R, T, A1, A2, A3>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3) const;
explicit BOOST_MEM_FN_NAME(cmf3)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf3)<R, T, A1, A2, A3, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3) const;
explicit BOOST_MEM_FN_NAME(cmf3)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf3)<R, T, A1, A2, A3>(f) {}
};
template<class R, class T, class A1, class A2, class A3, class A4> struct BOOST_MEM_FN_NAME(mf4): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf4)<R, T, A1, A2, A3, A4, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4)>
template<class R, class T, class A1, class A2, class A3, class A4> struct BOOST_MEM_FN_NAME(mf4): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf4)<R, T, A1, A2, A3, A4>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4);
explicit BOOST_MEM_FN_NAME(mf4)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf4)<R, T, A1, A2, A3, A4, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4);
explicit BOOST_MEM_FN_NAME(mf4)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf4)<R, T, A1, A2, A3, A4>(f) {}
};
template<class R, class T, class A1, class A2, class A3, class A4> struct BOOST_MEM_FN_NAME(cmf4): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf4)<R, T, A1, A2, A3, A4, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4) const>
template<class R, class T, class A1, class A2, class A3, class A4> struct BOOST_MEM_FN_NAME(cmf4): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf4)<R, T, A1, A2, A3, A4>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4) const;
explicit BOOST_MEM_FN_NAME(cmf4)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf4)<R, T, A1, A2, A3, A4, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4) const;
explicit BOOST_MEM_FN_NAME(cmf4)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf4)<R, T, A1, A2, A3, A4>(f) {}
};
template<class R, class T, class A1, class A2, class A3, class A4, class A5> struct BOOST_MEM_FN_NAME(mf5): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf5)<R, T, A1, A2, A3, A4, A5, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5)>
template<class R, class T, class A1, class A2, class A3, class A4, class A5> struct BOOST_MEM_FN_NAME(mf5): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf5)<R, T, A1, A2, A3, A4, A5>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5);
explicit BOOST_MEM_FN_NAME(mf5)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf5)<R, T, A1, A2, A3, A4, A5, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5);
explicit BOOST_MEM_FN_NAME(mf5)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf5)<R, T, A1, A2, A3, A4, A5>(f) {}
};
template<class R, class T, class A1, class A2, class A3, class A4, class A5> struct BOOST_MEM_FN_NAME(cmf5): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf5)<R, T, A1, A2, A3, A4, A5, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5) const>
template<class R, class T, class A1, class A2, class A3, class A4, class A5> struct BOOST_MEM_FN_NAME(cmf5): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf5)<R, T, A1, A2, A3, A4, A5>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5) const;
explicit BOOST_MEM_FN_NAME(cmf5)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf5)<R, T, A1, A2, A3, A4, A5, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5) const;
explicit BOOST_MEM_FN_NAME(cmf5)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf5)<R, T, A1, A2, A3, A4, A5>(f) {}
};
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> struct BOOST_MEM_FN_NAME(mf6): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf6)<R, T, A1, A2, A3, A4, A5, A6, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5, A6)>
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> struct BOOST_MEM_FN_NAME(mf6): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf6)<R, T, A1, A2, A3, A4, A5, A6>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6);
explicit BOOST_MEM_FN_NAME(mf6)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf6)<R, T, A1, A2, A3, A4, A5, A6, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6);
explicit BOOST_MEM_FN_NAME(mf6)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf6)<R, T, A1, A2, A3, A4, A5, A6>(f) {}
};
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> struct BOOST_MEM_FN_NAME(cmf6): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf6)<R, T, A1, A2, A3, A4, A5, A6, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5, A6) const>
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> struct BOOST_MEM_FN_NAME(cmf6): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf6)<R, T, A1, A2, A3, A4, A5, A6>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6) const;
explicit BOOST_MEM_FN_NAME(cmf6)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf6)<R, T, A1, A2, A3, A4, A5, A6, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6) const;
explicit BOOST_MEM_FN_NAME(cmf6)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf6)<R, T, A1, A2, A3, A4, A5, A6>(f) {}
};
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct BOOST_MEM_FN_NAME(mf7): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf7)<R, T, A1, A2, A3, A4, A5, A6, A7, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5, A6, A7)>
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct BOOST_MEM_FN_NAME(mf7): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf7)<R, T, A1, A2, A3, A4, A5, A6, A7>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7);
explicit BOOST_MEM_FN_NAME(mf7)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf7)<R, T, A1, A2, A3, A4, A5, A6, A7, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7);
explicit BOOST_MEM_FN_NAME(mf7)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf7)<R, T, A1, A2, A3, A4, A5, A6, A7>(f) {}
};
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct BOOST_MEM_FN_NAME(cmf7): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf7)<R, T, A1, A2, A3, A4, A5, A6, A7, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5, A6, A7) const>
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct BOOST_MEM_FN_NAME(cmf7): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf7)<R, T, A1, A2, A3, A4, A5, A6, A7>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7) const;
explicit BOOST_MEM_FN_NAME(cmf7)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf7)<R, T, A1, A2, A3, A4, A5, A6, A7, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7) const;
explicit BOOST_MEM_FN_NAME(cmf7)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf7)<R, T, A1, A2, A3, A4, A5, A6, A7>(f) {}
};
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct BOOST_MEM_FN_NAME(mf8): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5, A6, A7, A8)>
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct BOOST_MEM_FN_NAME(mf8): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8);
explicit BOOST_MEM_FN_NAME(mf8)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8);
explicit BOOST_MEM_FN_NAME(mf8)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8>(f) {}
};
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct BOOST_MEM_FN_NAME(cmf8): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5, A6, A7, A8) const>
template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct BOOST_MEM_FN_NAME(cmf8): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8>
{
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8) const;
explicit BOOST_MEM_FN_NAME(cmf8)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8, F>(f) {}
typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8) const;
explicit BOOST_MEM_FN_NAME(cmf8)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8>(f) {}
};

View File

@@ -1,49 +0,0 @@
#ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
#define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
#if _MSC_VER >= 1020
#pragma once
#endif
//
// bind/placeholders.hpp - _N definitions
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
// This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
//
// See http://www.boost.org/libs/bind/bind.html for documentation.
//
#include <boost/bind/arg.hpp>
#include <boost/config.hpp>
// With MSVC precompiled headers, unnamed namespaces are not unique
#ifdef BOOST_MSVC
# define BOOST_BIND_STATIC static
#else
# define BOOST_BIND_STATIC
#endif
namespace
{
BOOST_BIND_STATIC boost::arg<1> _1;
BOOST_BIND_STATIC boost::arg<2> _2;
BOOST_BIND_STATIC boost::arg<3> _3;
BOOST_BIND_STATIC boost::arg<4> _4;
BOOST_BIND_STATIC boost::arg<5> _5;
BOOST_BIND_STATIC boost::arg<6> _6;
BOOST_BIND_STATIC boost::arg<7> _7;
BOOST_BIND_STATIC boost::arg<8> _8;
BOOST_BIND_STATIC boost::arg<9> _9;
} // unnamed namespace
#undef BOOST_BIND_STATIC
#endif // #ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED

View File

@@ -31,12 +31,20 @@ template<class T> T * get_pointer(T * p)
return p;
}
// get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
// implementation of get_pointer for boost::shared_ptr
// this will probably migrate to boost/shared_ptr.hpp
#if defined(BOOST_NO_VOID_RETURNS)
template<class T> class shared_ptr;
#define BOOST_MEM_FN_CLASS_F , class F
#define BOOST_MEM_FN_TYPEDEF(X)
template<class T> T * get_pointer(shared_ptr<T> const & p)
{
return p.get();
}
// Void return workaround temporarily disabled on MSVC 6
// causes internal compiler errors with debug info enabled
#if defined(BOOST_NO_VOID_RETURNS) && !defined(BOOST_MSVC)
namespace _mfi // mem_fun_impl
{
@@ -99,9 +107,6 @@ template<> struct mf<void>
}; // struct mf<void>
#undef BOOST_MEM_FN_CLASS_F
#undef BOOST_MEM_FN_TYPEDEF_F
#define BOOST_MEM_FN_NAME(X) X
#define BOOST_MEM_FN_NAME2(X) inner_##X
#define BOOST_MEM_FN_CC
@@ -130,9 +135,6 @@ template<> struct mf<void>
#else // #ifdef BOOST_NO_VOID_RETURNS
#define BOOST_MEM_FN_CLASS_F
#define BOOST_MEM_FN_TYPEDEF(X) typedef X;
namespace _mfi
{
@@ -162,9 +164,6 @@ namespace _mfi
} // namespace _mfi
#undef BOOST_MEM_FN_CLASS_F
#undef BOOST_MEM_FN_TYPEDEF
#endif // #ifdef BOOST_NO_VOID_RETURNS
#define BOOST_MEM_FN_NAME(X) X

View File

@@ -75,7 +75,7 @@ define an enhanced <b>for_each</b> algorithm with an overload of the form:
</p>
<pre>
template&lt;class It, class R, class T&gt; void for_each(It first, It last, R (T::*pmf) ())
template&lt;class It, class R&gt; void for_each(It first, It last, R (*pmf) ())
{
std::for_each(first, last, boost::mem_fn(pmf));
}
@@ -93,10 +93,10 @@ that will allow the convenient syntax:
When documenting the feature, the library author will simply state:
</p>
<h4 style="margin-left: 20pt;">template&lt;class It, class R, class T&gt; void for_each(It first, It last, R (T::*pmf) ());</h4>
<h4 style="margin-left: 20pt;">template&lt;class It, class R&gt; void for_each(It first, It last, R (*pmf) ());</h4>
<p style="margin-left: 20pt;">
<b>Effects:</b> equivalent to std::for_each(first, last, boost::mem_fn(pmf));
<b>Effects:</b> equivalent to std::for_each(first, last, boost::mem_fn(pmf));</tt>
</p>
<p>
@@ -271,7 +271,7 @@ the return type of the member function pointer passed as an argument to <b>mem_f
<b>Throws:</b> Nothing.
</p>
<h3><a name="mem_fn">mem_fn</a></h3>
<a name="mem_fn"><h3>mem_fn</h3></a>
<h4><a name="mem_fn_1">template&lt;class R, class T&gt; <i>implementation-defined-1</i> mem_fn(R (T::*pmf) ())</a></h4>

View File

@@ -1,187 +0,0 @@
#if defined(_MSC_VER) && !defined(__ICL)
#pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion
#pragma warning(disable: 4514) // unreferenced inline removed
#endif
//
// mem_fn_derived_test.cpp - tests mem_fn.hpp with derived objects
//
// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
// This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
//
#include <boost/mem_fn.hpp>
#include <boost/shared_ptr.hpp>
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
#pragma warning(push, 3)
#endif
#include <iostream>
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
#pragma warning(pop)
#endif
struct B
{
mutable unsigned int hash;
B(): hash(0) {}
int f0() { f1(17); return 0; }
int g0() const { g1(17); return 0; }
int f1(int a1) { hash = (hash * 17041 + a1) % 32768; return 0; }
int g1(int a1) const { hash = (hash * 17041 + a1 * 2) % 32768; return 0; }
int f2(int a1, int a2) { f1(a1); f1(a2); return 0; }
int g2(int a1, int a2) const { g1(a1); g1(a2); return 0; }
int f3(int a1, int a2, int a3) { f2(a1, a2); f1(a3); return 0; }
int g3(int a1, int a2, int a3) const { g2(a1, a2); g1(a3); return 0; }
int f4(int a1, int a2, int a3, int a4) { f3(a1, a2, a3); f1(a4); return 0; }
int g4(int a1, int a2, int a3, int a4) const { g3(a1, a2, a3); g1(a4); return 0; }
int f5(int a1, int a2, int a3, int a4, int a5) { f4(a1, a2, a3, a4); f1(a5); return 0; }
int g5(int a1, int a2, int a3, int a4, int a5) const { g4(a1, a2, a3, a4); g1(a5); return 0; }
int f6(int a1, int a2, int a3, int a4, int a5, int a6) { f5(a1, a2, a3, a4, a5); f1(a6); return 0; }
int g6(int a1, int a2, int a3, int a4, int a5, int a6) const { g5(a1, a2, a3, a4, a5); g1(a6); return 0; }
int f7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) { f6(a1, a2, a3, a4, a5, a6); f1(a7); return 0; }
int g7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) const { g6(a1, a2, a3, a4, a5, a6); g1(a7); return 0; }
int f8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { f7(a1, a2, a3, a4, a5, a6, a7); f1(a8); return 0; }
int g8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) const { g7(a1, a2, a3, a4, a5, a6, a7); g1(a8); return 0; }
};
struct X: public B
{
};
int detect_errors(bool x)
{
if(x)
{
std::cerr << "no errors detected.\n";
return 0;
}
else
{
std::cerr << "test failed.\n";
return 1;
}
}
int main()
{
using boost::mem_fn;
X x;
X const & rcx = x;
X const * pcx = &x;
boost::shared_ptr<X> sp(new X);
mem_fn(&X::f0)(x);
mem_fn(&X::f0)(&x);
mem_fn(&X::f0)(sp);
mem_fn(&X::g0)(x);
mem_fn(&X::g0)(rcx);
mem_fn(&X::g0)(&x);
mem_fn(&X::g0)(pcx);
mem_fn(&X::g0)(sp);
mem_fn(&X::f1)(x, 1);
mem_fn(&X::f1)(&x, 1);
mem_fn(&X::f1)(sp, 1);
mem_fn(&X::g1)(x, 1);
mem_fn(&X::g1)(rcx, 1);
mem_fn(&X::g1)(&x, 1);
mem_fn(&X::g1)(pcx, 1);
mem_fn(&X::g1)(sp, 1);
mem_fn(&X::f2)(x, 1, 2);
mem_fn(&X::f2)(&x, 1, 2);
mem_fn(&X::f2)(sp, 1, 2);
mem_fn(&X::g2)(x, 1, 2);
mem_fn(&X::g2)(rcx, 1, 2);
mem_fn(&X::g2)(&x, 1, 2);
mem_fn(&X::g2)(pcx, 1, 2);
mem_fn(&X::g2)(sp, 1, 2);
mem_fn(&X::f3)(x, 1, 2, 3);
mem_fn(&X::f3)(&x, 1, 2, 3);
mem_fn(&X::f3)(sp, 1, 2, 3);
mem_fn(&X::g3)(x, 1, 2, 3);
mem_fn(&X::g3)(rcx, 1, 2, 3);
mem_fn(&X::g3)(&x, 1, 2, 3);
mem_fn(&X::g3)(pcx, 1, 2, 3);
mem_fn(&X::g3)(sp, 1, 2, 3);
mem_fn(&X::f4)(x, 1, 2, 3, 4);
mem_fn(&X::f4)(&x, 1, 2, 3, 4);
mem_fn(&X::f4)(sp, 1, 2, 3, 4);
mem_fn(&X::g4)(x, 1, 2, 3, 4);
mem_fn(&X::g4)(rcx, 1, 2, 3, 4);
mem_fn(&X::g4)(&x, 1, 2, 3, 4);
mem_fn(&X::g4)(pcx, 1, 2, 3, 4);
mem_fn(&X::g4)(sp, 1, 2, 3, 4);
mem_fn(&X::f5)(x, 1, 2, 3, 4, 5);
mem_fn(&X::f5)(&x, 1, 2, 3, 4, 5);
mem_fn(&X::f5)(sp, 1, 2, 3, 4, 5);
mem_fn(&X::g5)(x, 1, 2, 3, 4, 5);
mem_fn(&X::g5)(rcx, 1, 2, 3, 4, 5);
mem_fn(&X::g5)(&x, 1, 2, 3, 4, 5);
mem_fn(&X::g5)(pcx, 1, 2, 3, 4, 5);
mem_fn(&X::g5)(sp, 1, 2, 3, 4, 5);
mem_fn(&X::f6)(x, 1, 2, 3, 4, 5, 6);
mem_fn(&X::f6)(&x, 1, 2, 3, 4, 5, 6);
mem_fn(&X::f6)(sp, 1, 2, 3, 4, 5, 6);
mem_fn(&X::g6)(x, 1, 2, 3, 4, 5, 6);
mem_fn(&X::g6)(rcx, 1, 2, 3, 4, 5, 6);
mem_fn(&X::g6)(&x, 1, 2, 3, 4, 5, 6);
mem_fn(&X::g6)(pcx, 1, 2, 3, 4, 5, 6);
mem_fn(&X::g6)(sp, 1, 2, 3, 4, 5, 6);
mem_fn(&X::f7)(x, 1, 2, 3, 4, 5, 6, 7);
mem_fn(&X::f7)(&x, 1, 2, 3, 4, 5, 6, 7);
mem_fn(&X::f7)(sp, 1, 2, 3, 4, 5, 6, 7);
mem_fn(&X::g7)(x, 1, 2, 3, 4, 5, 6, 7);
mem_fn(&X::g7)(rcx, 1, 2, 3, 4, 5, 6, 7);
mem_fn(&X::g7)(&x, 1, 2, 3, 4, 5, 6, 7);
mem_fn(&X::g7)(pcx, 1, 2, 3, 4, 5, 6, 7);
mem_fn(&X::g7)(sp, 1, 2, 3, 4, 5, 6, 7);
mem_fn(&X::f8)(x, 1, 2, 3, 4, 5, 6, 7, 8);
mem_fn(&X::f8)(&x, 1, 2, 3, 4, 5, 6, 7, 8);
mem_fn(&X::f8)(sp, 1, 2, 3, 4, 5, 6, 7, 8);
mem_fn(&X::g8)(x, 1, 2, 3, 4, 5, 6, 7, 8);
mem_fn(&X::g8)(rcx, 1, 2, 3, 4, 5, 6, 7, 8);
mem_fn(&X::g8)(&x, 1, 2, 3, 4, 5, 6, 7, 8);
mem_fn(&X::g8)(pcx, 1, 2, 3, 4, 5, 6, 7, 8);
mem_fn(&X::g8)(sp, 1, 2, 3, 4, 5, 6, 7, 8);
return detect_errors(x.hash == 17610 && sp->hash == 2155);
}

View File

@@ -19,7 +19,7 @@
#define BOOST_MEM_FN_ENABLE_STDCALL
#include <boost/mem_fn.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/smart_ptr.hpp>
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
#pragma warning(push, 3)

View File

@@ -17,7 +17,7 @@
//
#include <boost/mem_fn.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/smart_ptr.hpp>
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
#pragma warning(push, 3)

View File

@@ -17,7 +17,7 @@
//
#include <boost/mem_fn.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/smart_ptr.hpp>
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
#pragma warning(push, 3)

View File

@@ -17,7 +17,7 @@
<td align="center">
<table border="0">
<tr><td nowrap><h1>ref.hpp</h1></td></tr>
<tr><td align="right" nowrap><small>&nbsp;1.00.0004 (2002-01-27)</small></td></tr>
<tr><td align="right" nowrap><small>&nbsp;1.00.0003 (2001-08-22)</small></td></tr>
</table>
</td>
</tr>
@@ -35,9 +35,8 @@
<p>
The header <a href="../../boost/ref.hpp">boost/ref.hpp</a> defines the class template
<b>boost::reference_wrapper&lt;T&gt;</b>, the two functions <b>boost::ref</b> and
<b>boost::cref</b> that return instances of
<b>boost::reference_wrapper&lt;T&gt;</b>, and the two traits classes <b>boost::is_reference_wrapper&lt;T&gt;</b> and <b>boost::unwrap_reference&lt;T&gt;</b>.
<b>boost::reference_wrapper&lt;T&gt;</b> and the two functions <b>boost::ref</b> and
<b>boost::cref</b> that return instances of <b>boost::reference_wrapper&lt;T&gt;</b>.
</p>
<p>
@@ -53,8 +52,8 @@ work on references unmodified.
</p>
<p>
<b>boost::reference_wrapper&lt;T&gt;</b> is both <b>CopyConstructible</b> and
<b>Assignable</b> (ordinary references are not <b>Assignable</b>).
<b>boost::reference_wrapper&lt;T&gt;</b> is <b>CopyConstructible</b>, but it is not
<b>Assignable</b>.
</p>
<p>
@@ -63,14 +62,6 @@ where <b>X</b> is the type of <b>x</b>. Similarly, <b>boost::cref(x)</b>
returns a <b>boost::reference_wrapper&lt;X const&gt;(x)</b>.
</p>
<p>The expression <b>boost::is_reference_wrapper&lt;T&gt;::value</b> is
<b>true</b> if <b>T</b> is a
<b>reference_wrapper</b>, and <b>false</b> otherwise.
<p>The type-expression <b>boost::unwrap_reference&lt;T&gt;::type</b>
is <b>T::type</b> if <b>T</b> is a
<b>reference_wrapper</b>, <b>T</b> otherwise.
<h2>Interface</h2>
<h3>Synopsis</h3>
@@ -81,8 +72,6 @@ namespace boost
template&lt;class T&gt; class <a href="#reference_wrapper">reference_wrapper</a>;
template&lt;class T&gt; reference_wrapper&lt;T&gt; <a href="#ref">ref</a>(T &amp; t);
template&lt;class T&gt; reference_wrapper&lt;T const&gt; <a href="#cref">cref</a>(T const &amp; t);
template&lt;class T&gt; class is_reference_wrapper&lt;T const&gt;;
template&lt;class T&gt; class unwrap_reference&lt;T const&gt;;
}
</pre>
@@ -92,7 +81,6 @@ namespace boost
template&lt;class T&gt; class reference_wrapper
{
public:
typedef T type;
explicit <a href="#rt_construct">reference_wrapper</a>(T &amp; t);
@@ -104,36 +92,30 @@ public:
<h4><a name="rt_construct">explicit reference_wrapper(T &amp; t)</a></h4>
<blockquote>
<p>
<b>Effects:</b> Constructs a <b>reference_wrapper</b> object that stores a reference to <b>t</b>.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
</blockquote>
<h4><a name="rt_operator">operator T &amp; () const</a></h4>
<blockquote>
<p>
<b>Returns:</b> the stored reference.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
</blockquote>
<h4><a name="rt_get">T &amp; get() const</a></h4>
<blockquote>
<p>
<b>Returns:</b> the stored reference.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
</blockquote>
<h3><a name="ref">ref</a></h3>
@@ -141,14 +123,12 @@ public:
template&lt;class T&gt; reference_wrapper&lt;T&gt; ref(T &amp; t);
</pre>
<blockquote>
<p>
<b>Returns:</b> <tt>reference_wrapper&lt;T&gt;(t)</tt>.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
</blockquote>
<h3><a name="cref">cref</a></h3>
@@ -156,47 +136,19 @@ template&lt;class T&gt; reference_wrapper&lt;T&gt; ref(T &amp; t);
template&lt;class T&gt; reference_wrapper&lt;T const&gt; cref(T const &amp; t);
</pre>
<blockquote>
<p>
<b>Returns:</b> <tt>reference_wrapper&lt;T const&gt;(t)</tt>.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
</blockquote>
<h3><a name="is_reference_wrapper">is_reference_wrapper</a></h3>
<pre>
template&lt;class T&gt; class is_reference_wrapper&lt;T const&gt;
{
public:
static bool value = <i>unspecified</i>;
};
</pre>
Value is <b>true</b> iff <tt>T</tt> is a specialization of <tt>reference_wrapper</tt>.
<h3><a name="unwrap_reference">unwrap_reference</a></h3>
<pre>
template&lt;class T&gt; class unwrap_reference&lt;T const&gt;
{
public:
typedef <i>unspecified</i> type;
};
</pre>
<tt>type</tt> is equivalent to <tt>T::type</tt> if <tt>T</tt> is a specialization of <tt>reference_wrapper</tt>. Otherwise <tt>type</tt> is equivalent to <tt>T</tt>.
<h2>Acknowledgements</h2>
<p>
<b>ref</b> and <b>cref</b> were originally part of the Boost.Tuple
library by <a href="../../people/jaakko_jarvi.htm"> Jaakko
J&auml;rvi</a>. They were "promoted to <b>boost::</b> status" by <a
href="../../people/peter_dimov.htm">Peter Dimov</a> because they are
generally useful. <a href="../../people/doug_gregor.html">Douglas
Gregor</a> and <a href="../../people/dave_abrahams.htm">Dave
Abrahams</a> contributed <tt>is_reference_wrapper</tt> and
<tt>unwrap_reference</tt>.
<b>ref</b> and <b>cref</b> were originally part of the Boost.Tuple library.
They were "promoted to <b>boost::</b> status" because they are generally
useful.
</p>