Compare commits

..

2 Commits

Author SHA1 Message Date
nobody
1aa02850b7 This commit was manufactured by cvs2svn to create tag
'Version_1_27_0'.

[SVN r12749]
2002-02-07 13:33:59 +00:00
nobody
fb72a35ee2 This commit was manufactured by cvs2svn to create branch 'RC_1_27_0'.
[SVN r12739]
2002-02-06 03:32:50 +00:00
12 changed files with 1418 additions and 1841 deletions

1632
bind.html

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
#if defined(_MSC_VER) && !defined(__ICL) && !defined(__COMO__) #if defined(_MSC_VER) && !defined(__ICL)
#pragma warning(disable: 4786) // identifier truncated in debug info #pragma warning(disable: 4786) // identifier truncated in debug info
#pragma warning(disable: 4710) // function not inlined #pragma warning(disable: 4710) // function not inlined
#pragma warning(disable: 4711) // function selected for automatic inline expansion #pragma warning(disable: 4711) // function selected for automatic inline expansion
@@ -8,7 +8,7 @@
// //
// bind_test.cpp - monolithic test for bind.hpp // bind_test.cpp - monolithic test for bind.hpp
// //
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2001 David Abrahams // Copyright (c) 2001 David Abrahams
// //
// Permission to copy, use, modify, sell and distribute this software // Permission to copy, use, modify, sell and distribute this software
@@ -372,7 +372,7 @@ void member_function_test()
bind(&X::g8, x, 1, 2, 3, 4, 5, 6, 7, 8)(); bind(&X::g8, x, 1, 2, 3, 4, 5, 6, 7, 8)();
bind(&X::g8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8)(); bind(&X::g8, ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
BOOST_TEST( bind(&X::hash, _1)(x) == 23558 ); BOOST_TEST( x.hash == 23558 );
} }
void member_function_void_test() void member_function_void_test()
@@ -462,7 +462,7 @@ void member_function_void_test()
bind(&V::g8, v, 1, 2, 3, 4, 5, 6, 7, 8)(); bind(&V::g8, v, 1, 2, 3, 4, 5, 6, 7, 8)();
bind(&V::g8, ref(v), 1, 2, 3, 4, 5, 6, 7, 8)(); bind(&V::g8, ref(v), 1, 2, 3, 4, 5, 6, 7, 8)();
BOOST_TEST( bind(&V::hash, _1)(v) == 23558 ); BOOST_TEST( v.hash == 23558 );
} }
void nested_bind_test() void nested_bind_test()

View File

@@ -146,8 +146,6 @@ public:
A1 operator[] (arg<1>) const { return a1_; } A1 operator[] (arg<1>) const { return a1_; }
A1 operator[] (arg<1> (*) ()) const { return a1_; }
template<class T> T & operator[] (value<T> & v) const { return v.get(); } template<class T> T & operator[] (value<T> & v) const { return v.get(); }
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); } template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
@@ -193,9 +191,6 @@ public:
A1 operator[] (arg<1>) const { return a1_; } A1 operator[] (arg<1>) const { return a1_; }
A2 operator[] (arg<2>) const { return a2_; } A2 operator[] (arg<2>) const { return a2_; }
A1 operator[] (arg<1> (*) ()) const { return a1_; }
A2 operator[] (arg<2> (*) ()) const { return a2_; }
template<class T> T & operator[] (value<T> & v) const { return v.get(); } template<class T> T & operator[] (value<T> & v) const { return v.get(); }
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); } template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
@@ -244,10 +239,6 @@ public:
A2 operator[] (arg<2>) const { return a2_; } A2 operator[] (arg<2>) const { return a2_; }
A3 operator[] (arg<3>) const { return a3_; } A3 operator[] (arg<3>) const { return a3_; }
A1 operator[] (arg<1> (*) ()) const { return a1_; }
A2 operator[] (arg<2> (*) ()) const { return a2_; }
A3 operator[] (arg<3> (*) ()) const { return a3_; }
template<class T> T & operator[] (value<T> & v) const { return v.get(); } template<class T> T & operator[] (value<T> & v) const { return v.get(); }
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); } template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
@@ -299,11 +290,6 @@ public:
A3 operator[] (arg<3>) const { return a3_; } A3 operator[] (arg<3>) const { return a3_; }
A4 operator[] (arg<4>) const { return a4_; } A4 operator[] (arg<4>) const { return a4_; }
A1 operator[] (arg<1> (*) ()) const { return a1_; }
A2 operator[] (arg<2> (*) ()) const { return a2_; }
A3 operator[] (arg<3> (*) ()) const { return a3_; }
A4 operator[] (arg<4> (*) ()) const { return a4_; }
template<class T> T & operator[] (value<T> & v) const { return v.get(); } template<class T> T & operator[] (value<T> & v) const { return v.get(); }
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); } template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
@@ -358,12 +344,6 @@ public:
A4 operator[] (arg<4>) const { return a4_; } A4 operator[] (arg<4>) const { return a4_; }
A5 operator[] (arg<5>) const { return a5_; } A5 operator[] (arg<5>) const { return a5_; }
A1 operator[] (arg<1> (*) ()) const { return a1_; }
A2 operator[] (arg<2> (*) ()) const { return a2_; }
A3 operator[] (arg<3> (*) ()) const { return a3_; }
A4 operator[] (arg<4> (*) ()) const { return a4_; }
A5 operator[] (arg<5> (*) ()) const { return a5_; }
template<class T> T & operator[] (value<T> & v) const { return v.get(); } template<class T> T & operator[] (value<T> & v) const { return v.get(); }
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); } template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
@@ -421,13 +401,6 @@ public:
A5 operator[] (arg<5>) const { return a5_; } A5 operator[] (arg<5>) const { return a5_; }
A6 operator[] (arg<6>) const { return a6_; } A6 operator[] (arg<6>) const { return a6_; }
A1 operator[] (arg<1> (*) ()) const { return a1_; }
A2 operator[] (arg<2> (*) ()) const { return a2_; }
A3 operator[] (arg<3> (*) ()) const { return a3_; }
A4 operator[] (arg<4> (*) ()) const { return a4_; }
A5 operator[] (arg<5> (*) ()) const { return a5_; }
A6 operator[] (arg<6> (*) ()) const { return a6_; }
template<class T> T & operator[] (value<T> & v) const { return v.get(); } template<class T> T & operator[] (value<T> & v) const { return v.get(); }
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); } template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
@@ -488,14 +461,6 @@ public:
A6 operator[] (arg<6>) const { return a6_; } A6 operator[] (arg<6>) const { return a6_; }
A7 operator[] (arg<7>) const { return a7_; } A7 operator[] (arg<7>) const { return a7_; }
A1 operator[] (arg<1> (*) ()) const { return a1_; }
A2 operator[] (arg<2> (*) ()) const { return a2_; }
A3 operator[] (arg<3> (*) ()) const { return a3_; }
A4 operator[] (arg<4> (*) ()) const { return a4_; }
A5 operator[] (arg<5> (*) ()) const { return a5_; }
A6 operator[] (arg<6> (*) ()) const { return a6_; }
A7 operator[] (arg<7> (*) ()) const { return a7_; }
template<class T> T & operator[] (value<T> & v) const { return v.get(); } template<class T> T & operator[] (value<T> & v) const { return v.get(); }
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); } template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
@@ -559,15 +524,6 @@ public:
A7 operator[] (arg<7>) const { return a7_; } A7 operator[] (arg<7>) const { return a7_; }
A8 operator[] (arg<8>) const { return a8_; } A8 operator[] (arg<8>) const { return a8_; }
A1 operator[] (arg<1> (*) ()) const { return a1_; }
A2 operator[] (arg<2> (*) ()) const { return a2_; }
A3 operator[] (arg<3> (*) ()) const { return a3_; }
A4 operator[] (arg<4> (*) ()) const { return a4_; }
A5 operator[] (arg<5> (*) ()) const { return a5_; }
A6 operator[] (arg<6> (*) ()) const { return a6_; }
A7 operator[] (arg<7> (*) ()) const { return a7_; }
A8 operator[] (arg<8> (*) ()) const { return a8_; }
template<class T> T & operator[] (value<T> & v) const { return v.get(); } template<class T> T & operator[] (value<T> & v) const { return v.get(); }
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); } template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
@@ -634,16 +590,6 @@ public:
A8 operator[] (arg<8>) const { return a8_; } A8 operator[] (arg<8>) const { return a8_; }
A9 operator[] (arg<9>) const { return a9_; } A9 operator[] (arg<9>) const { return a9_; }
A1 operator[] (arg<1> (*) ()) const { return a1_; }
A2 operator[] (arg<2> (*) ()) const { return a2_; }
A3 operator[] (arg<3> (*) ()) const { return a3_; }
A4 operator[] (arg<4> (*) ()) const { return a4_; }
A5 operator[] (arg<5> (*) ()) const { return a5_; }
A6 operator[] (arg<6> (*) ()) const { return a6_; }
A7 operator[] (arg<7> (*) ()) const { return a7_; }
A8 operator[] (arg<8> (*) ()) const { return a8_; }
A9 operator[] (arg<9> (*) ()) const { return a9_; }
template<class T> T & operator[] (value<T> & v) const { return v.get(); } template<class T> T & operator[] (value<T> & v) const { return v.get(); }
template<class T> T const & operator[] (value<T> const & v) const { return v.get(); } template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
@@ -970,11 +916,6 @@ template<int I> struct add_value< arg<I> >
typedef arg<I> type; typedef arg<I> type;
}; };
template<int I> struct add_value< arg<I> (*) () >
{
typedef arg<I> (*type) ();
};
template<class R, class F, class L> struct add_value< bind_t<R, F, L> > template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
{ {
typedef bind_t<R, F, L> type; typedef bind_t<R, F, L> type;
@@ -1006,7 +947,6 @@ typedef char (&_avt_r2) [2];
template<class T> _avt_r1 _avt_f(value<T>); template<class T> _avt_r1 _avt_f(value<T>);
template<class T> _avt_r1 _avt_f(reference_wrapper<T>); template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
template<int I> _avt_r1 _avt_f(arg<I>); template<int I> _avt_r1 _avt_f(arg<I>);
template<int I> _avt_r1 _avt_f(arg<I> (*) ());
template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>); template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
_avt_r2 _avt_f(...); _avt_r2 _avt_f(...);
@@ -1355,17 +1295,6 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
#endif #endif
// data member pointers
template<class R, class T, class A1>
_bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
BOOST_BIND(R T::*f, A1 a1)
{
typedef _mfi::dm<R, T> F;
typedef typename _bi::list_av_1<A1>::type list_type;
return _bi::bind_t<R, F, list_type>(F(f), list_type(a1));
}
} // namespace boost } // namespace boost
#ifndef BOOST_BIND_NO_PLACEHOLDERS #ifndef BOOST_BIND_NO_PLACEHOLDERS

View File

@@ -1,75 +0,0 @@
#ifndef BOOST_BIND_APPLY_HPP_INCLUDED
#define BOOST_BIND_APPLY_HPP_INCLUDED
//
// apply.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.
//
namespace boost
{
template<class R> struct apply
{
typedef R result_type;
template<class F> result_type operator()(F f) const
{
return f();
}
template<class F, class A1> result_type operator()(F f, A1 & a1) const
{
return f(a1);
}
template<class F, class A1, class A2> result_type operator()(F f, A1 & a1, A2 & a2) const
{
return f(a1, a2);
}
template<class F, class A1, class A2, class A3> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3) const
{
return f(a1, a2, a3);
}
template<class F, class A1, class A2, class A3, class A4> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
{
return f(a1, a2, a3, a4);
}
template<class F, class A1, class A2, class A3, class A4, class A5> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
{
return f(a1, a2, a3, a4, a5);
}
template<class F, class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
{
return f(a1, a2, a3, a4, a5, a6);
}
template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
{
return f(a1, a2, a3, a4, a5, a6, a7);
}
template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
{
return f(a1, a2, a3, a4, a5, a6, a7, a8);
}
template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
{
return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
}
};
} // namespace boost
#endif // #ifndef BOOST_BIND_APPLY_HPP_INCLUDED

View File

@@ -1,172 +0,0 @@
#ifndef BOOST_BIND_MAKE_ADAPTABLE_HPP_INCLUDED
#define BOOST_BIND_MAKE_ADAPTABLE_HPP_INCLUDED
//
// make_adaptable.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.
//
namespace boost
{
namespace _bi
{
template<class F> void instantiate(F)
{
}
template<class R, class F> class af0
{
public:
typedef R result_type;
explicit af0(F f): f_(f)
{
}
result_type operator()()
{
return f_();
}
private:
F f_;
};
template<class R, class A1, class F> class af1
{
public:
typedef R result_type;
typedef A1 argument_type;
typedef A1 arg1_type;
explicit af1(F f): f_(f)
{
}
result_type operator()(A1 a1)
{
return f_(a1);
}
private:
F f_;
};
template<class R, class A1, class A2, class F> class af2
{
public:
typedef R result_type;
typedef A1 first_argument_type;
typedef A2 second_argument_type;
typedef A1 arg1_type;
typedef A2 arg2_type;
explicit af2(F f): f_(f)
{
}
result_type operator()(A1 a1, A2 a2)
{
return f_(a1, a2);
}
private:
F f_;
};
template<class R, class A1, class A2, class A3, class F> class af3
{
public:
typedef R result_type;
typedef A1 arg1_type;
typedef A2 arg2_type;
typedef A3 arg3_type;
explicit af3(F f): f_(f)
{
}
result_type operator()(A1 a1, A2 a2, A3 a3)
{
return f_(a1, a2, a3);
}
private:
F f_;
};
template<class R, class A1, class A2, class A3, class A4, class F> class af4
{
public:
typedef R result_type;
typedef A1 arg1_type;
typedef A2 arg2_type;
typedef A3 arg3_type;
typedef A4 arg4_type;
explicit af4(F f): f_(f)
{
}
result_type operator()(A1 a1, A2 a2, A3 a3, A4 a4)
{
return f_(a1, a2, a3, a4);
}
private:
F f_;
};
} // namespace _bi
template<class R, class F> _bi::af0<R, F> make_adaptable(F f)
{
_bi::instantiate( &_bi::af0<R, F>::operator() ); // for early error detection
return _bi::af0<R, F>(f);
}
template<class R, class A1, class F> _bi::af1<R, A1, F> make_adaptable(F f)
{
instantiate( &_bi::af1<R, A1, F>::operator() );
return _bi::af1<R, A1, F>(f);
}
template<class R, class A1, class A2, class F> _bi::af2<R, A1, A2, F> make_adaptable(F f)
{
instantiate( &_bi::af2<R, A1, A2, F>::operator() );
return _bi::af2<R, A1, A2, F>(f);
}
template<class R, class A1, class A2, class A3, class F> _bi::af3<R, A1, A2, A3, F> make_adaptable(F f)
{
instantiate( &_bi::af3<R, A1, A2, A3, F>::operator() );
return _bi::af3<R, A1, A2, A3, F>(f);
}
template<class R, class A1, class A2, class A3, class A4, class F> _bi::af4<R, A1, A2, A3, A4, F> make_adaptable(F f)
{
instantiate( &_bi::af4<R, A1, A2, A3, A4, F>::operator() );
return _bi::af4<R, A1, A2, A3, A4, F>(f);
}
} // namespace boost
#endif // #ifndef BOOST_BIND_MAKE_ADAPTABLE_HPP_INCLUDED

View File

@@ -21,47 +21,29 @@
#include <boost/bind/arg.hpp> #include <boost/bind/arg.hpp>
#include <boost/config.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 namespace
{ {
#if defined(__BORLANDC__) BOOST_BIND_STATIC boost::arg<1> _1;
BOOST_BIND_STATIC boost::arg<2> _2;
static inline boost::arg<1> _1() { return boost::arg<1>(); } BOOST_BIND_STATIC boost::arg<3> _3;
static inline boost::arg<2> _2() { return boost::arg<2>(); } BOOST_BIND_STATIC boost::arg<4> _4;
static inline boost::arg<3> _3() { return boost::arg<3>(); } BOOST_BIND_STATIC boost::arg<5> _5;
static inline boost::arg<4> _4() { return boost::arg<4>(); } BOOST_BIND_STATIC boost::arg<6> _6;
static inline boost::arg<5> _5() { return boost::arg<5>(); } BOOST_BIND_STATIC boost::arg<7> _7;
static inline boost::arg<6> _6() { return boost::arg<6>(); } BOOST_BIND_STATIC boost::arg<8> _8;
static inline boost::arg<7> _7() { return boost::arg<7>(); } BOOST_BIND_STATIC boost::arg<9> _9;
static inline boost::arg<8> _8() { return boost::arg<8>(); }
static inline boost::arg<9> _9() { return boost::arg<9>(); }
#elif defined(BOOST_MSVC)
static boost::arg<1> _1;
static boost::arg<2> _2;
static boost::arg<3> _3;
static boost::arg<4> _4;
static boost::arg<5> _5;
static boost::arg<6> _6;
static boost::arg<7> _7;
static boost::arg<8> _8;
static boost::arg<9> _9;
#else
boost::arg<1> _1;
boost::arg<2> _2;
boost::arg<3> _3;
boost::arg<4> _4;
boost::arg<5> _5;
boost::arg<6> _6;
boost::arg<7> _7;
boost::arg<8> _8;
boost::arg<9> _9;
#endif
} // unnamed namespace } // unnamed namespace
#undef BOOST_BIND_STATIC
#endif // #ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED #endif // #ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED

View File

@@ -1,145 +0,0 @@
#ifndef BOOST_BIND_PROTECT_HPP_INCLUDED
#define BOOST_BIND_PROTECT_HPP_INCLUDED
//
// protect.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.
//
namespace boost
{
namespace _bi
{
template<class F> class protected_bind_t
{
public:
typedef typename F::result_type result_type;
explicit protected_bind_t(F f): f_(f)
{
}
result_type operator()()
{
return f_();
}
result_type operator()() const
{
return f_();
}
template<class A1> result_type operator()(A1 & a1)
{
return f_(a1);
}
template<class A1> result_type operator()(A1 & a1) const
{
return f_(a1);
}
template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2)
{
return f_(a1, a2);
}
template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2) const
{
return f_(a1, a2);
}
template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3)
{
return f_(a1, a2, a3);
}
template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3) const
{
return f_(a1, a2, a3);
}
template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4)
{
return f_(a1, a2, a3, a4);
}
template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
{
return f_(a1, a2, a3, a4);
}
template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5)
{
return f_(a1, a2, a3, a4, a5);
}
template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
{
return f_(a1, a2, a3, a4, a5);
}
template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6)
{
return f_(a1, a2, a3, a4, a5, a6);
}
template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
{
return f_(a1, a2, a3, a4, a5, a6);
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7)
{
return f_(a1, a2, a3, a4, a5, a6, a7);
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
{
return f_(a1, a2, a3, a4, a5, a6, a7);
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8)
{
return f_(a1, a2, a3, a4, a5, a6, a7, a8);
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
{
return f_(a1, a2, a3, a4, a5, a6, a7, a8);
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9)
{
return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
{
return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
}
private:
F f_;
};
} // namespace _bi
template<class F> _bi::protected_bind_t<F> protect(F f)
{
return _bi::protected_bind_t<F>(f);
}
} // namespace boost
#endif // #ifndef BOOST_BIND_PROTECT_HPP_INCLUDED

View File

@@ -8,7 +8,7 @@
// //
// mem_fn.hpp - a generalization of std::mem_fun[_ref] // mem_fn.hpp - a generalization of std::mem_fun[_ref]
// //
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2001 David Abrahams // Copyright (c) 2001 David Abrahams
// //
// Permission to copy, use, modify, sell and distribute this software // Permission to copy, use, modify, sell and distribute this software
@@ -187,79 +187,6 @@ namespace _mfi
#endif #endif
// data member support
namespace _mfi
{
template<class R, class T> class dm
{
public:
typedef R const & result_type;
typedef T const * argument_type;
private:
typedef R (T::*F);
F f_;
template<class U> R const & call(U & u, T const *) const
{
return (u.*f_);
}
template<class U> R & call(U & u, T *) const
{
return (u.*f_);
}
template<class U> R const & call(U & u, void const *) const
{
return (get_pointer(u)->*f_);
}
public:
explicit dm(F f): f_(f) {}
R & operator()(T * p) const
{
return (p->*f_);
}
R const & operator()(T const * p) const
{
return (p->*f_);
}
template<class U> R const & operator()(U & u) const
{
return call(u, &u);
}
#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1300)
R & operator()(T & t) const
{
return (t.*f_);
}
#endif
R const & operator()(T const & t) const
{
return (t.*f_);
}
};
} // namespace _mfi
template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f)
{
return _mfi::dm<R, T>(f);
}
} // namespace boost } // namespace boost
#endif // #ifndef BOOST_MEM_FN_HPP_INCLUDED #endif // #ifndef BOOST_MEM_FN_HPP_INCLUDED

View File

@@ -1,95 +1,116 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head>
<title>Boost: mem_fn.hpp documentation</title> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head> <title>Boost: mem_fn.hpp documentation</title>
<body bgcolor="white" style="MARGIN-LEFT: 5%; MARGIN-RIGHT: 5%"> </head>
<table border="0" width="100%">
<tr> <body bgcolor="White" style="margin-left: 5%; margin-right: 5%;">
<td width="277">
<img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"> <table border="0" width="100%">
</td> <tr>
<td align="middle"> <td width="277">
<h1>mem_fn.hpp</h1> <img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86">
</td> </td>
</tr> <td align="center">
<tr> <h1>mem_fn.hpp</h1>
<td colspan="2" height="64">&nbsp;</td> </td>
</tr> </tr>
</table> <tr>
<h2>Contents</h2> <td colspan="2" height="64">&nbsp;</td>
<h3 style="MARGIN-LEFT: 20pt"><a href="#Purpose">Purpose</a></h3> </tr>
<h3 style="MARGIN-LEFT: 20pt"><a href="#FAQ">Frequently Asked Questions</a></h3> </table>
<h4 style="MARGIN-LEFT: 40pt"><a href="#Q1">Can <b>mem_fn</b> be used instead of the
standard <b>std::mem_fun[_ref]</b> adaptors?</a></h4> <h2>Contents</h2>
<h4 style="MARGIN-LEFT: 40pt"><a href="#Q2">Should I replace every occurence of <b>std::mem_fun[_ref]</b>
with <b>mem_fn</b> in my existing code?</a></h4> <h3 style="margin-left: 20pt;"><a href="#Purpose">Purpose</a></h3>
<h4 style="MARGIN-LEFT: 40pt"><a href="#Q3">Does <b>mem_fn</b> work with COM methods?</a></h4> <h3 style="margin-left: 20pt;"><a href="#FAQ">Frequently Asked Questions</a></h3>
<h4 style="MARGIN-LEFT: 40pt"><a href="#Q4">Why isn't BOOST_MEM_FN_ENABLE_STDCALL <h4 style="margin-left: 40pt;"><a href="#Q1">Can <b>mem_fn</b> be used instead of the standard
defined automatically?</a></h4> <b>std::mem_fun[_ref]</b> adaptors?</a></h4>
<h3 style="MARGIN-LEFT: 20pt"><a href="#Interface">Interface</a></h3> <h4 style="margin-left: 40pt;"><a href="#Q2">Should I replace every occurence of <b>std::mem_fun[_ref]</b>
<h4 style="MARGIN-LEFT: 40pt"><a href="#Synopsis">Synopsis</a></h4> with <b>mem_fn</b> in my existing code?</a></h4>
<h4 style="MARGIN-LEFT: 40pt"><a href="#CommonRequirements">Common requirements</a></h4> <h4 style="margin-left: 40pt;"><a href="#Q3">Does <b>mem_fn</b> work with COM methods?</a></h4>
<h4 style="MARGIN-LEFT: 40pt"><a href="#get_pointer">get_pointer</a></h4> <h4 style="margin-left: 40pt;"><a href="#Q4">Why isn't BOOST_MEM_FN_ENABLE_STDCALL defined automatically?</a></h4>
<h4 style="MARGIN-LEFT: 40pt"><a href="#mem_fn">mem_fn</a></h4> <h3 style="margin-left: 20pt;"><a href="#Interface">Interface</a></h3>
<h3 style="MARGIN-LEFT: 20pt"><a href="#Implementation">Implementation</a></h3> <h4 style="margin-left: 40pt;"><a href="#Synopsis">Synopsis</a></h4>
<h4 style="MARGIN-LEFT: 40pt"><a href="#Files">Files</a></h4> <h4 style="margin-left: 40pt;"><a href="#CommonRequirements">Common requirements</a></h4>
<h4 style="MARGIN-LEFT: 40pt"><a href="#Dependencies">Dependencies</a></h4> <h4 style="margin-left: 40pt;"><a href="#get_pointer">get_pointer</a></h4>
<h4 style="MARGIN-LEFT: 40pt"><a href="#NumberOfArguments">Number of Arguments</a></h4> <h4 style="margin-left: 40pt;"><a href="#mem_fn">mem_fn</a></h4>
<h4 style="MARGIN-LEFT: 40pt"><a href="#stdcall">"__stdcall" Support</a></h4> <h3 style="margin-left: 20pt;"><a href="#Implementation">Implementation</a></h3>
<h3 style="MARGIN-LEFT: 20pt"><a href="#Acknowledgements">Acknowledgements</a></h3> <h4 style="margin-left: 40pt;"><a href="#Files">Files</a></h4>
<h2><a name="Purpose">Purpose</a></h2> <h4 style="margin-left: 40pt;"><a href="#Dependencies">Dependencies</a></h4>
<p> <h4 style="margin-left: 40pt;"><a href="#NumberOfArguments">Number of Arguments</a></h4>
<b>boost::mem_fn</b> is a generalization of the standard functions <b>std::mem_fun</b> <h4 style="margin-left: 40pt;"><a href="#stdcall">&quot;__stdcall&quot; Support</a></h4>
and <b>std::mem_fun_ref</b>. It supports member function pointers with more <h3 style="margin-left: 20pt;"><a href="#Acknowledgements">Acknowledgements</a></h3>
than one argument, and the returned function object can take a pointer, a
reference, or a smart pointer to an object instance as its first argument. <h2><a name="Purpose">Purpose</a></h2>
</p>
<p> <p>
The purpose of <b>mem_fn</b> is twofold. First, it allows users to invoke a <b>boost::mem_fn</b> is a generalization of the standard functions
member function on a container with the familiar <b>std::mem_fun</b> and <b>std::mem_fun_ref</b>. It supports member
</p> function pointers with more than one argument, and the returned function
<pre> object can take a pointer, a reference, or a smart pointer to an object
instance as its first argument.
</p>
<p>
The purpose of <b>mem_fn</b> is twofold. First, it allows users to invoke a
member function on a container with the familiar
</p>
<pre>
std::for_each(v.begin(), v.end(), boost::mem_fn(&amp;Shape::draw)); std::for_each(v.begin(), v.end(), boost::mem_fn(&amp;Shape::draw));
</pre> </pre>
<p>
syntax, even when the container stores smart pointers. <p>
</p> syntax, even when the container stores smart pointers.
<p> </p>
Second, it can be used as a building block by library developers that want to
treat a pointer to member function as a function object. A library might define <p>
an enhanced <b>for_each</b> algorithm with an overload of the form: Second, it can be used as a building block by library developers that want
</p> to treat a pointer to member function as a function object. A library might
<pre> 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, class T&gt; void for_each(It first, It last, R (T::*pmf) ())
{ {
std::for_each(first, last, boost::mem_fn(pmf)); std::for_each(first, last, boost::mem_fn(pmf));
} }
</pre> </pre>
<p>
that will allow the convenient syntax: <p>
</p> that will allow the convenient syntax:
<pre> </p>
<pre>
for_each(v.begin(), v.end(), &amp;Shape::draw); for_each(v.begin(), v.end(), &amp;Shape::draw);
</pre> </pre>
<p>
When documenting the feature, the library author will simply state: <p>
</p> When documenting the feature, the library author will simply state:
<h4 style="MARGIN-LEFT: 20pt">template&lt;class It, class R, class T&gt; void </p>
for_each(It first, It last, R (T::*pmf) ());</h4>
<p style="MARGIN-LEFT: 20pt"> <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>
<b>Effects:</b> equivalent to std::for_each(first, last, boost::mem_fn(pmf));
</p> <p style="margin-left: 20pt;">
<p> <b>Effects:</b> equivalent to std::for_each(first, last, boost::mem_fn(pmf));
where <b>boost::mem_fn</b> can be a link to this page. See <a href="bind.html">the </p>
documentation of <b>bind</b></a> for an example.
</p> <p>
<p> where <b>boost::mem_fn</b> can be a link to this page. See
<b>mem_fn</b> takes one argument, a pointer to a member function, and returns a <a href="bind.html">the documentation of <b>bind</b></a> for an example.
function object suitable for use with standard or user-defined algorithms: </p>
</p>
<pre> <p>
<b>mem_fn</b> takes one argument, a pointer to a member function, and
returns a function object suitable for use with standard or user-defined
algorithms:
</p>
<pre>
struct X struct X
{ {
void f(); void f();
@@ -110,72 +131,97 @@ void k(std::vector&lt;boost::shared_ptr&lt;X&gt; &gt; const &amp; v)
std::for_each(v.begin(), v.end(), boost::mem_fn(&amp;X::f)); std::for_each(v.begin(), v.end(), boost::mem_fn(&amp;X::f));
}; };
</pre> </pre>
<p>
The returned function object takes the same arguments as the input member <p>
function plus a "flexible" first argument that represents the object instance. The returned function object takes the same arguments as the input member
</p> function plus a "flexible" first argument that represents the object instance.
<p> </p>
When the function object is invoked with a first argument <b>x</b> that is
neither a pointer nor a reference to the appropriate class (<b>X</b> in the <p>
example above), it uses <tt>get_pointer(x)</tt> to obtain a pointer from <b>x</b>. When the function object is invoked with a first argument <b>x</b> that is
Library authors can "register" their smart pointer classes by supplying an neither a pointer nor a reference to the appropriate class (<b>X</b> in the
appropriate <b>get_pointer</b> overload, allowing <b>mem_fn</b> to recognize example above), it uses <tt>get_pointer(x)</tt> to obtain a pointer from
and support them. <b>x</b>. Library authors can "register" their smart pointer classes by
</p> supplying an appropriate <b>get_pointer</b> overload, allowing <b>mem_fn</b>
<p> to recognize and support them.
[Note: <b>get_pointer</b> is not restricted to return a pointer. Any object </p>
that can be used in a member function call expression <tt>(x-&gt;*pmf)(...)</tt>
will work.] <p>
</p> A <b>get_pointer</b> overload for <b>boost::shared_ptr</b> is supplied.
<p> </p>
[Note: the library uses an unqualified call to <b>get_pointer</b>. Therefore,
it will find, through argument-dependent lookup, <b>get_pointer</b> overloads <p>
that are defined in the same namespace as the corresponding smart pointer [Note: <b>get_pointer</b> is not restricted to return a pointer. Any object
class, in addition to any <b>boost::get_pointer</b> overloads.] that can be used in a member function call expression <tt>(x->*pmf)(...)</tt>
</p> will work.]
<p> </p>
All function objects returned by <b>mem_fn</b> expose a <b>result_type</b> typedef
that represents the return type of the member function. <p>
</p> [Note: the library uses an unqualified call to <b>get_pointer</b>. Therefore,
<h2><a name="FAQ">Frequently Asked Questions</a></h2> it will find, through argument-dependent lookup, <b>get_pointer</b> overloads
<h3><a name="Q1">Can <b>mem_fn</b> be used instead of the standard <b>std::mem_fun[_ref]</b> that are defined in the same namespace as the corresponding smart pointer
adaptors?</a></h3> class, in addition to any <b>boost::get_pointer</b> overloads.]
<p> </p>
Yes. For simple uses, <b>mem_fn</b> provides additional functionality that the
standard adaptors do not. Complicated expressions that use <b>std::bind1st</b>, <b>std::bind2nd</b> <p>
or <a href="../compose/index.htm"><b>Boost.Compose</b></a> along with the All function objects returned by <b>mem_fn</b> expose a <b>result_type</b>
standard adaptors can be rewritten using <a href="bind.html"><b>boost::bind</b></a> typedef that represents the return type of the member function.
that automatically takes advantage of <b>mem_fn</b>. </p>
</p>
<h3><a name="Q2">Should I replace every occurence of <b>std::mem_fun[_ref]</b> with <b>mem_fn</b> <h2><a name="FAQ">Frequently Asked Questions</a></h2>
in my existing code?</a></h3>
<p> <h3><a name="Q1">Can <b>mem_fn</b> be used instead of the standard
No, unless you have good reasons to do so. <b>mem_fn</b> is not 100% compatible <b>std::mem_fun[_ref]</b> adaptors?</a></h3>
with the standard adaptors, although it comes pretty close. In particular, <b>mem_fn</b>
does not return objects of type <b>std::[const_]mem_fun[1][_ref]_t</b>, as the <p>
standard adaptors do, and it is not possible to fully describe the type of the Yes. For simple uses, <b>mem_fn</b> provides additional functionality that
first argument using the standard <b>argument_type</b> and <b>first_argument_type</b> the standard adaptors do not. Complicated expressions that use <b>std::bind1st</b>,
nested typedefs. Libraries that need adaptable function objects in order to <b>std::bind2nd</b> or <a href="../compose/index.htm"><b>Boost.Compose</b></a>
function might not like <b>mem_fn</b>. along with the standard adaptors can be rewritten using
</p> <a href="bind.html"><b>boost::bind</b></a> that automatically takes advantage of
<h3><a name="Q3">Does <b>mem_fn</b> work with COM methods?</a></h3> <b>mem_fn</b>.
<p> </p>
Yes, if you <a href="#stdcall">#define BOOST_MEM_FN_ENABLE_STDCALL</a>.
</p> <h3><a name="Q2">Should I replace every occurence of <b>std::mem_fun[_ref]</b>
<h3><a name="Q4">Why isn't BOOST_MEM_FN_ENABLE_STDCALL defined automatically?</a></h3> with <b>mem_fn</b> in my existing code?</a></h3>
<p>
Non-portable extensions, in general, should default to off to prevent vendor <p>
lock-in. Had BOOST_MEM_FN_ENABLE_STDCALL been defined automatically, you could No, unless you have good reasons to do so. <b>mem_fn</b> is not 100% compatible
have accidentally taken advantage of it without realizing that your code is, with the standard adaptors, although it comes pretty close. In particular,
perhaps, no longer portable. <b>mem_fn</b> does not return objects of type
</p> <b>std::[const_]mem_fun[1][_ref]_t</b>, as the standard adaptors do, and it is
<h2><a name="Interface">Interface</a></h2> not possible to fully describe the type of the first argument using the standard
<h3><a name="Synopsis">Synopsis</a></h3> <b>argument_type</b> and <b>first_argument_type</b> nested typedefs. Libraries
<pre> that need adaptable function objects in order to function might not like
<b>mem_fn</b>.
</p>
<h3><a name="Q3">Does <b>mem_fn</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="Q4">Why isn't BOOST_MEM_FN_ENABLE_STDCALL defined automatically?</a></h3>
<p>
Non-portable extensions, in general, should default to off to prevent vendor
lock-in. Had BOOST_MEM_FN_ENABLE_STDCALL been defined automatically, you could
have accidentally taken advantage of it without realizing that your code is,
perhaps, no longer portable.
</p>
<h2><a name="Interface">Interface</a></h2>
<h3><a name="Synopsis">Synopsis</a></h3>
<pre>
namespace boost namespace boost
{ {
template&lt;class T&gt; T * <a href="#get_pointer_1">get_pointer</a> (T * p); template&lt;class T&gt; T * <a href="#get_pointer_1">get_pointer</a>(T * p);
template&lt;class T&gt; T * <a href="#get_pointer_2">get_pointer</a>(shared_ptr&lt;T&gt; const &amp; p);
template&lt;class R, class T&gt; <i>implementation-defined-1</i> <a href="#mem_fn_1">mem_fn</a>(R (T::*pmf) ()); template&lt;class R, class T&gt; <i>implementation-defined-1</i> <a href="#mem_fn_1">mem_fn</a>(R (T::*pmf) ());
@@ -193,179 +239,189 @@ template&lt;class R, class T, class A1, class A2&gt; <i>implementation-defined-6
} }
</pre> </pre>
<h3><a name="CommonRequirements">Common requirements</a></h3>
<p> <h3><a name="CommonRequirements">Common requirements</a></h3>
All <tt><i>implementation-defined-N</i></tt> types mentioned in the Synopsis
are <b>CopyConstructible</b> and <b>Assignable</b>. Their copy constructors and <p>
assignment operators do not throw exceptions. <tt><i>implementation-defined-N</i>::result_type</tt> All <tt><i>implementation-defined-N</i></tt> types mentioned in the Synopsis are
is defined as the return type of the member function pointer passed as an <b>CopyConstructible</b> and <b>Assignable</b>.
argument to <b>mem_fn</b> (<b>R</b> in the Synopsis.) Their copy constructors and assignment operators do not throw exceptions.
</p> <tt><i>implementation-defined-N</i>::result_type</tt> is defined as
<h3><a name="get_pointer">get_pointer</a></h3> the return type of the member function pointer passed as an argument to <b>mem_fn</b>
<h4><a name="get_pointer_1">template&lt;class T&gt; T * get_pointer(T * p)</a></h4> (<b>R</b> in the Synopsis.)
<blockquote> </p>
<p>
<b>Returns:</b> <tt>p</tt>. <h3><a name="get_pointer">get_pointer</a></h3>
</p>
<p> <h4><a name="get_pointer_1">template&lt;class T&gt; T * get_pointer(T * p)</a></h4>
<b>Throws:</b> Nothing.
</p> <p>
</blockquote> <b>Returns:</b> <tt>p</tt>.
<h3><a name="mem_fn">mem_fn</a></h3> </p>
<h4><a name="mem_fn_1">template&lt;class R, class T&gt; <i>implementation-defined-1</i> <p>
mem_fn(R (T::*pmf) ())</a></h4> <b>Throws:</b> Nothing.
<blockquote> </p>
<p>
<b>Returns:</b> a function object <i>f</i> such that the expression <tt><i>f(t)</i></tt> <h4><a name="get_pointer_2">template&lt;class T&gt; T * get_pointer(shared_ptr&lt;T&gt; const &amp; p)</a></h4>
is equivalent to <tt>(t.*pmf)()</tt> when <i>t</i> is an l-value of type <STRONG>T </STRONG>
or derived, <tt>(get_pointer(t)-&gt;*pmf)()</tt> otherwise. <p>
</p> <b>Returns:</b> <tt>p.get()</tt>.
<p> </p>
<b>Throws:</b> Nothing. <p>
</p> <b>Throws:</b> Nothing.
</blockquote> </p>
<h4><a name="mem_fn_2">template&lt;class R, class T&gt; <i>implementation-defined-2</i>
mem_fn(R (T::*pmf) () const)</a></h4> <h3><a name="mem_fn">mem_fn</a></h3>
<blockquote>
<p> <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>
<b>Returns:</b> a function object <i>f</i> such that the expression <tt><i>f(t)</i></tt>
is equivalent to <tt>(t.*pmf)()</tt> when <i>t</i> is of type <STRONG>T</STRONG> <p>
<EM>[const]<STRONG> </STRONG></EM>or derived, <tt>(get_pointer(t)-&gt;*pmf)()</tt> <b>Returns:</b> a function object <i>f</i> such that the expression
otherwise. <tt><i>f(t)</i></tt> is equivalent to <tt>(t.*pmf)()</tt> when <i>t</i>
</p> is an l-value of type <b>T</b>, <tt>(get_pointer(t)->*pmf)()</tt> otherwise.
<p> </p>
<b>Throws:</b> Nothing. <p>
</p> <b>Throws:</b> Nothing.
</blockquote> </p>
<h4><a name="mem_fn_3">template&lt;class R, class T, class A1&gt; <i>implementation-defined-3</i>
mem_fn(R (T::*pmf) (A1))</a></h4> <h4><a name="mem_fn_2">template&lt;class R, class T&gt; <i>implementation-defined-2</i> mem_fn(R (T::*pmf) () const)</a></h4>
<blockquote>
<p> <p>
<b>Returns:</b> a function object <i>f</i> such that the expression <tt><i>f(t, a1)</i></tt> <b>Returns:</b> a function object <i>f</i> such that the expression
is equivalent to <tt>(t.*pmf)(a1)</tt> when <i>t</i> is an l-value of type <STRONG>T <tt><i>f(t)</i></tt> is equivalent to <tt>(t.*pmf)()</tt> when <i>t</i>
</STRONG>or derived, <tt>(get_pointer(t)-&gt;*pmf)(a1)</tt> otherwise. is of type <b>T <i>[</i>const<i>]</i></b>, <tt>(get_pointer(t)->*pmf)()</tt> otherwise.
</p> </p>
<p> <p>
<b>Throws:</b> Nothing. <b>Throws:</b> Nothing.
</p> </p>
</blockquote>
<h4><a name="mem_fn_4">template&lt;class R, class T, class A1&gt; <i>implementation-defined-4</i> <h4><a name="mem_fn_3">template&lt;class R, class T, class A1&gt; <i>implementation-defined-3</i> mem_fn(R (T::*pmf) (A1))</a></h4>
mem_fn(R (T::*pmf) (A1) const)</a></h4>
<blockquote> <p>
<p> <b>Returns:</b> a function object <i>f</i> such that the expression
<b>Returns:</b> a function object <i>f</i> such that the expression <tt><i>f(t, a1)</i></tt> <tt><i>f(t, a1)</i></tt> is equivalent to <tt>(t.*pmf)(a1)</tt> when <i>t</i>
is equivalent to <tt>(t.*pmf)(a1)</tt> when <i>t</i> is of type <STRONG>T</STRONG> is an l-value of type <b>T</b>, <tt>(get_pointer(t)->*pmf)(a1)</tt> otherwise.
<EM>[const]<STRONG> </STRONG></EM>or derived, <tt>(get_pointer(t)-&gt;*pmf)(a1)</tt> </p>
otherwise. <p>
</p> <b>Throws:</b> Nothing.
<p> </p>
<b>Throws:</b> Nothing.
</p> <h4><a name="mem_fn_4">template&lt;class R, class T, class A1&gt; <i>implementation-defined-4</i> mem_fn(R (T::*pmf) (A1) const)</a></h4>
</blockquote>
<h4><a name="mem_fn_5">template&lt;class R, class T, class A1, class A2&gt; <i>implementation-defined-5</i> <p>
mem_fn(R (T::*pmf) (A1, A2))</a></h4> <b>Returns:</b> a function object <i>f</i> such that the expression
<blockquote> <tt><i>f(t, a1)</i></tt> is equivalent to <tt>(t.*pmf)(a1)</tt> when <i>t</i>
<p> is of type <b>T <i>[</i>const<i>]</i></b>, <tt>(get_pointer(t)->*pmf)(a1)</tt> otherwise.
<b>Returns:</b> a function object <i>f</i> such that the expression <tt><i>f(t, a1, a2)</i></tt> </p>
is equivalent to <tt>(t.*pmf)(a1, a2)</tt> when <i>t</i> is an l-value of type <STRONG> <p>
T</STRONG> or derived, <tt>(get_pointer(t)-&gt;*pmf)(a1, a2)</tt> otherwise. <b>Throws:</b> Nothing.
</p> </p>
<p>
<b>Throws:</b> Nothing. <h4><a name="mem_fn_5">template&lt;class R, class T, class A1, class A2&gt; <i>implementation-defined-5</i> mem_fn(R (T::*pmf) (A1, A2))</a></h4>
</p>
</blockquote> <p>
<h4><a name="mem_fn_6">template&lt;class R, class T, class A1, class A2&gt; <i>implementation-defined-6</i> <b>Returns:</b> a function object <i>f</i> such that the expression
mem_fn(R (T::*pmf) (A1, A2) const)</a></h4> <tt><i>f(t, a1, a2)</i></tt> is equivalent to <tt>(t.*pmf)(a1, a2)</tt> when <i>t</i>
<blockquote> is an l-value of type <b>T</b>, <tt>(get_pointer(t)->*pmf)(a1, a2)</tt> otherwise.
<p> </p>
<b>Returns:</b> a function object <i>f</i> such that the expression <tt><i>f(t, a1, a2)</i></tt> <p>
is equivalent to <tt>(t.*pmf)(a1, a2)</tt> when <i>t</i> is of type <STRONG>T</STRONG> <b>Throws:</b> Nothing.
<EM>[const]</EM> or derived, <tt>(get_pointer(t)-&gt;*pmf)(a1, a2)</tt> otherwise. </p>
</p>
<p> <h4><a name="mem_fn_6">template&lt;class R, class T, class A1, class A2&gt; <i>implementation-defined-6</i> mem_fn(R (T::*pmf) (A1, A2) const)</a></h4>
<b>Throws:</b> Nothing.
</p> <p>
</blockquote> <b>Returns:</b> a function object <i>f</i> such that the expression
<h2><a name="Implementation">Implementation</a></h2> <tt><i>f(t, a1, a2)</i></tt> is equivalent to <tt>(t.*pmf)(a1, a2)</tt> when <i>t</i>
<h3><a name="Files">Files</a></h3> is of type <b>T <i>[</i>const<i>]</i></b>, <tt>(get_pointer(t)->*pmf)(a1, a2)</tt> otherwise.
<ul> </p>
<li> <p>
<a href="../../boost/mem_fn.hpp">boost/mem_fn.hpp</a> <b>Throws:</b> Nothing.
(main header) </p>
<li>
<a href="../../boost/bind/mem_fn_cc.hpp">boost/bind/mem_fn_cc.hpp</a> <h2><a name="Implementation">Implementation</a></h2>
(used by mem_fn.hpp, do not include directly)
<li> <h3><a name="Files">Files</a></h3>
<a href="../../boost/bind/mem_fn_vw.hpp">boost/bind/mem_fn_vw.hpp</a> <ul>
(used by mem_fn.hpp, do not include directly) <li><a href="../../boost/mem_fn.hpp">boost/mem_fn.hpp</a> (main header)
<li> <li><a href="../../boost/bind/mem_fn_cc.hpp">boost/bind/mem_fn_cc.hpp</a> (used by mem_fn.hpp, do not include directly)
<a href="../../boost/bind/mem_fn_template.hpp">boost/bind/mem_fn_template.hpp</a> <li><a href="../../boost/bind/mem_fn_vw.hpp">boost/bind/mem_fn_vw.hpp</a> (used by mem_fn.hpp, do not include directly)
(used by mem_fn.hpp, do not include directly) <li><a href="../../boost/bind/mem_fn_template.hpp">boost/bind/mem_fn_template.hpp</a> (used by mem_fn.hpp, do not include directly)
<li> <li><a href="mem_fn_test.cpp">libs/bind/mem_fn_test.cpp</a> (test)
<a href="mem_fn_test.cpp">libs/bind/mem_fn_test.cpp</a> <li><a href="mem_fn_stdcall_test.cpp">libs/bind/mem_fn_stdcall_test.cpp</a> (test for __stdcall)
(test) <li><a href="mem_fn_void_test.cpp">libs/bind/mem_fn_void_test.cpp</a> (test for void returns)
<li> </ul>
<a href="mem_fn_stdcall_test.cpp">libs/bind/mem_fn_stdcall_test.cpp</a>
(test for __stdcall) <h3><a name="Dependencies">Dependencies</a></h3>
<li> <ul>
<a href="mem_fn_void_test.cpp">libs/bind/mem_fn_void_test.cpp</a> (test for <li><a href="../config/config.htm">Boost.Config</a>
void returns)</li> </ul>
</ul>
<h3><a name="Dependencies">Dependencies</a></h3> <h3><a name="NumberOfArguments">Number of Arguments</a></h3>
<ul>
<li> <p>
<a href="../config/config.htm">Boost.Config</a></li> This implementation supports member functions with up to eight arguments.
</ul> This is not an inherent limitation of the design, but an implementation
<h3><a name="NumberOfArguments">Number of Arguments</a></h3> detail.
<p> </p>
This implementation supports member functions with up to eight arguments. This
is not an inherent limitation of the design, but an implementation detail. <h3><a name="stdcall">&quot;__stdcall&quot; Support</a></h3>
</p>
<h3><a name="stdcall">"__stdcall" Support</a></h3> <p>
<p> Some platforms allow several types of member functions that differ by their
Some platforms allow several types of member functions that differ by their <b>calling <b>calling convention</b> (the rules by which the function is invoked: how
convention</b> (the rules by which the function is invoked: how are are arguments passed, how is the return value handled, and who cleans up the
arguments passed, how is the return value handled, and who cleans up the stack stack - if any.)
- if any.) </p>
</p>
<p> <p>
For example, Windows API functions and COM interface member functions use a For example, Windows API functions and COM interface member functions use a
calling convention known as <b>__stdcall</b>. calling convention known as <b>__stdcall</b>.
</p> </p>
<p>
To use <b>mem_fn</b> with <b>__stdcall</b> member functions, <b>#define</b> the <p>
macro <b>BOOST_MEM_FN_ENABLE_STDCALL</b> before including, directly or To use <b>mem_fn</b> with <b>__stdcall</b> member functions, <b>#define</b>
indirectly, <b>&lt;boost/mem_fn.hpp&gt;</b>. the macro <b>BOOST_MEM_FN_ENABLE_STDCALL</b> before including, directly or
</p> indirectly, <b>&lt;boost/mem_fn.hpp&gt;</b>.
<p> </p>
[Note: this is a non-portable extension. It is not part of the interface.]
</p> <p>
<p> [Note: this is a non-portable extension. It is not part of the interface.]
[Note: Some compilers provide only minimal support for the <b>__stdcall</b> keyword.] </p>
</p>
<h2><a name="Acknowledgements">Acknowledgements</a></h2> <p>
<p> [Note: Some compilers provide only minimal support for the <b>__stdcall</b> keyword.]
Rene Jager's initial suggestion of using traits classes to make <b>mem_fn</b> adapt </p>
to user-defined smart pointers inspired the <b>get_pointer</b>-based design.
</p>
<p> <h2><a name="Acknowledgements">Acknowledgements</a></h2>
Numerous improvements were suggested during the formal review period by Richard
Crossley, Jens Maurer, Ed Brey, and others. Review manager was Darin Adler. <p>
</p> Rene Jager's initial suggestion of using traits classes to make
<p> <b>mem_fn</b> adapt to user-defined smart pointers inspired the
Steve Anichini pointed out that COM interfaces use <b>__stdcall</b>. <b>get_pointer</b>-based design.
</p> </p>
<p>
Dave Abrahams modified <b>bind</b> and <b>mem_fn</b> to support void returns on <p>
deficient compilers. Numerous improvements were suggested during the formal review period by
</p> Richard Crossley, Jens Maurer, Ed Brey, and others. Review manager
<p><br> was Darin Adler.
<br> </p>
<br>
<small>Copyright © 2001, 2002&nbsp;by Peter Dimov and Multi Media Ltd. Permission <p>
to copy, use, modify, sell and distribute this document is granted provided Steve Anichini pointed out that COM interfaces use <b>__stdcall</b>.
this copyright notice appears in all copies. This document is provided "as is" </p>
without express or implied warranty, and with no claim as to its suitability
for any purpose.</small></p> <p>
</body> Dave Abrahams modified <b>bind</b> and <b>mem_fn</b> to support void returns
on deficient compilers.
</p>
<p><br><br><br><small>Copyright &copy; 2001 by Peter Dimov and Multi Media
Ltd. Permission to copy, use, modify, sell and distribute this document is
granted provided this copyright notice appears in all copies. This document
is provided &quot;as is&quot; without express or implied warranty, and with
no claim as to its suitability for any purpose.</small></p>
</body>
</html> </html>

View File

@@ -8,7 +8,7 @@
// //
// mem_fn_derived_test.cpp - tests mem_fn.hpp with derived objects // mem_fn_derived_test.cpp - tests mem_fn.hpp with derived objects
// //
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
// //
// Permission to copy, use, modify, sell and distribute this software // Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies. // is granted provided this copyright notice appears in all copies.
@@ -183,5 +183,5 @@ int main()
mem_fn(&X::g8)(pcx, 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); mem_fn(&X::g8)(sp, 1, 2, 3, 4, 5, 6, 7, 8);
return detect_errors(mem_fn(&X::hash)(x) == 17610 && mem_fn(&X::hash)(sp) == 2155); return detect_errors(x.hash == 17610 && sp->hash == 2155);
} }

View File

@@ -8,7 +8,7 @@
// //
// mem_fn_test.cpp - a test for mem_fn.hpp // mem_fn_test.cpp - a test for mem_fn.hpp
// //
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
// //
// Permission to copy, use, modify, sell and distribute this software // Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies. // is granted provided this copyright notice appears in all copies.
@@ -179,5 +179,5 @@ int main()
mem_fn(&X::g8)(pcx, 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); mem_fn(&X::g8)(sp, 1, 2, 3, 4, 5, 6, 7, 8);
return detect_errors(mem_fn(&X::hash)(x) == 17610 && mem_fn(&X::hash)(sp) == 2155); return detect_errors(x.hash == 17610 && sp->hash == 2155);
} }

323
ref.html
View File

@@ -1,75 +1,81 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <head>
<title>Boost: ref.hpp documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head> <title>Boost: ref.hpp documentation</title>
<body bgcolor="White"> </head>
<table border="0" width="100%">
<tr> <body bgcolor="White">
<td width="277">
<img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"> <table border="0" width="100%">
</td> <tr>
<td align="center"> <td width="277">
<table border="0"> <img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86">
<tr> </td>
<td nowrap><h1>ref.hpp</h1> <td align="center">
</td> <table border="0">
</tr> <tr><td nowrap><h1>ref.hpp</h1></td></tr>
<tr> <tr><td align="right" nowrap><small>&nbsp;1.00.0004 (2002-01-27)</small></td></tr>
<td align="right" nowrap><small>&nbsp;1.00.0004 (2002-01-27)</small></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" height="64">&nbsp;</td>
</tr>
</table> </table>
<h2>Files</h2> </td>
<ul> </tr>
<li> <tr>
<a href="../../boost/ref.hpp">ref.hpp</a> <td colspan="2" height="64">&nbsp;</td>
</ul> </tr>
<h2>Purpose</h2> </table>
<p>
The header <a href="../../boost/ref.hpp">boost/ref.hpp</a> defines the class <h2>Files</h2>
template <b>boost::reference_wrapper&lt;T&gt;</b>, the two functions <b>boost::ref</b> <ul>
and <b>boost::cref</b> that return instances of <b>boost::reference_wrapper&lt;T&gt;</b>, <li><a href="../../boost/ref.hpp">ref.hpp</a>
and the two traits classes <b>boost::is_reference_wrapper&lt;T&gt;</b> and <b>boost::unwrap_reference&lt;T&gt;</b>. </ul>
</p>
<p> <h2>Purpose</h2>
The purpose of <b>boost::reference_wrapper&lt;T&gt;</b> is to contain a
reference to an object of type <b>T</b>. It is primarily used to "feed" <p>
references to function templates (algorithms) that take their parameter by The header <a href="../../boost/ref.hpp">boost/ref.hpp</a> defines the class template
value. <b>boost::reference_wrapper&lt;T&gt;</b>, the two functions <b>boost::ref</b> and
</p> <b>boost::cref</b> that return instances of
<p> <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>.
To support this usage, <b>boost::reference_wrapper&lt;T&gt;</b> provides an </p>
implicit conversion to <b>T &amp;</b>. This usually allows the function
templates to work on references unmodified. <p>
</p> The purpose of <b>boost::reference_wrapper&lt;T&gt;</b> is to contain a reference to
<p> an object of type <b>T</b>. It is primarily used to "feed" references to
<b>boost::reference_wrapper&lt;T&gt;</b> is both <b>CopyConstructible</b> and <b>Assignable</b> function templates (algorithms) that take their parameter by value.
(ordinary references are not <b>Assignable</b>). </p>
</p>
<p> <p>
The expression <b>boost::ref(x)</b> returns a <b>boost::reference_wrapper&lt;X&gt;(x)</b> To support this usage, <b>boost::reference_wrapper&lt;T&gt;</b> provides an implicit
where <b>X</b> is the type of <b>x</b>. Similarly, <b>boost::cref(x)</b> returns conversion to <b>T &amp;</b>. This usually allows the function templates to
a <b>boost::reference_wrapper&lt;X const&gt;(x)</b>. work on references unmodified.
</p> </p>
<p>
The expression <b>boost::is_reference_wrapper&lt;T&gt;::value</b> is <b>true</b> <p>
if <b>T</b> is a <b>reference_wrapper</b>, and <b>false</b> <b>boost::reference_wrapper&lt;T&gt;</b> is both <b>CopyConstructible</b> and
otherwise. <b>Assignable</b> (ordinary references are not <b>Assignable</b>).
</p> </p>
<p>
The type-expression <b>boost::unwrap_reference&lt;T&gt;::type</b> is <b>T::type</b> <p>
if <b>T</b> is a <b>reference_wrapper</b>, <b>T</b> otherwise. The expression <b>boost::ref(x)</b> returns a <b>boost::reference_wrapper&lt;X&gt;(x)</b>
</p> where <b>X</b> is the type of <b>x</b>. Similarly, <b>boost::cref(x)</b>
<h2>Interface</h2> returns a <b>boost::reference_wrapper&lt;X const&gt;(x)</b>.
<h3>Synopsis</h3> </p>
<pre>
<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>
<pre>
namespace boost namespace boost
{ {
template&lt;class T&gt; class <a href="#reference_wrapper">reference_wrapper</a>; template&lt;class T&gt; class <a href="#reference_wrapper">reference_wrapper</a>;
@@ -79,8 +85,10 @@ namespace boost
template&lt;class T&gt; class unwrap_reference&lt;T const&gt;; template&lt;class T&gt; class unwrap_reference&lt;T const&gt;;
} }
</pre> </pre>
<h3><a name="reference_wrapper">reference_wrapper</a></h3>
<pre> <h3><a name="reference_wrapper">reference_wrapper</a></h3>
<pre>
template&lt;class T&gt; class reference_wrapper template&lt;class T&gt; class reference_wrapper
{ {
public: public:
@@ -91,105 +99,112 @@ public:
<a href="#rt_operator">operator T &amp;</a> () const; <a href="#rt_operator">operator T &amp;</a> () const;
T &amp; <a href="#rt_get">get</a>() const; T &amp; <a href="#rt_get">get</a>() const;
T* <a href="#rt_get_pointer">get_pointer</a>() const;
}; };
</pre> </pre>
<h4><a name="rt_construct">explicit reference_wrapper(T &amp; t)</a></h4>
<blockquote> <h4><a name="rt_construct">explicit reference_wrapper(T &amp; t)</a></h4>
<p>
<b>Effects:</b> Constructs a <b>reference_wrapper</b> object that stores a <blockquote>
reference to <b>t</b>. <p>
</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>
</p> <b>Throws:</b> Nothing.
</blockquote> </p>
<h4><a name="rt_operator">operator T &amp; () const</a></h4> </blockquote>
<blockquote>
<p> <h4><a name="rt_operator">operator T &amp; () const</a></h4>
<b>Returns:</b> the stored reference.
</p> <blockquote>
<p> <p>
<b>Throws:</b> Nothing. <b>Returns:</b> the stored reference.
</p> </p>
</blockquote> <p>
<h4><a name="rt_get">T &amp; get() const</a></h4> <b>Throws:</b> Nothing.
<blockquote> </p>
<p> </blockquote>
<b>Returns:</b> the stored reference.
</p> <h4><a name="rt_get">T &amp; get() const</a></h4>
<p>
<b>Throws:</b> Nothing. <blockquote>
</p> <p>
</blockquote> <b>Returns:</b> the stored reference.
<h4><a name="rt_get_pointer">T* get_pointer() const</a></h4> </p>
<blockquote> <p>
<p> <b>Throws:</b> Nothing.
<b>Returns:</b> a pointer to the stored object. </p>
</p> </blockquote>
<p>
<b>Throws:</b> Nothing. <h3><a name="ref">ref</a></h3>
</p>
</blockquote> <pre>
<h3><a name="ref">ref</a></h3>
<pre>
template&lt;class T&gt; reference_wrapper&lt;T&gt; ref(T &amp; t); template&lt;class T&gt; reference_wrapper&lt;T&gt; ref(T &amp; t);
</pre> </pre>
<blockquote>
<p> <blockquote>
<b>Returns:</b> <tt>reference_wrapper&lt;T&gt;(t)</tt>. <p>
</p> <b>Returns:</b> <tt>reference_wrapper&lt;T&gt;(t)</tt>.
<p> </p>
<b>Throws:</b> Nothing. <p>
</p> <b>Throws:</b> Nothing.
</blockquote> </p>
<h3><a name="cref">cref</a></h3> </blockquote>
<pre>
<h3><a name="cref">cref</a></h3>
<pre>
template&lt;class T&gt; reference_wrapper&lt;T const&gt; cref(T const &amp; t); template&lt;class T&gt; reference_wrapper&lt;T const&gt; cref(T const &amp; t);
</pre> </pre>
<blockquote>
<p> <blockquote>
<b>Returns:</b> <tt>reference_wrapper&lt;T const&gt;(t)</tt>. <p>
</p> <b>Returns:</b> <tt>reference_wrapper&lt;T const&gt;(t)</tt>.
<p> </p>
<b>Throws:</b> Nothing. <p>
</p> <b>Throws:</b> Nothing.
</blockquote> </p>
<h3><a name="is_reference_wrapper">is_reference_wrapper</a></h3> </blockquote>
<pre>
<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; template&lt;class T&gt; class is_reference_wrapper&lt;T const&gt;
{ {
public: public:
static bool value = <i>unspecified</i>; static bool value = <i>unspecified</i>;
}; };
</pre> </pre>
Value is <b>true</b> iff <tt>T</tt> is a specialization of <tt>reference_wrapper</tt>. 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> <h3><a name="unwrap_reference">unwrap_reference</a></h3>
<pre>
template&lt;class T&gt; class unwrap_reference&lt;T const&gt; template&lt;class T&gt; class unwrap_reference&lt;T const&gt;
{ {
public: public:
typedef <i>unspecified</i> type; typedef <i>unspecified</i> type;
}; };
</pre> </pre>
<tt>type</tt> is equivalent to <tt>T::type</tt> if <tt>T</tt> is a <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>.
specialization of <tt>reference_wrapper</tt>. Otherwise <tt>type</tt> is
equivalent to <tt>T</tt>. <h2>Acknowledgements</h2>
<h2>Acknowledgements</h2>
<p> <p>
<b>ref</b> and <b>cref</b> were originally part of the Boost.Tuple library by <a href="../../people/jaakko_jarvi.htm"> <b>ref</b> and <b>cref</b> were originally part of the Boost.Tuple
Jaakko J&auml;rvi</a>. They were "promoted to <b>boost::</b> status" by <a href="../../people/peter_dimov.htm"> library by <a href="../../people/jaakko_jarvi.htm"> Jaakko
Peter Dimov</a> because they are generally useful. <a href="../../people/doug_gregor.html"> J&auml;rvi</a>. They were "promoted to <b>boost::</b> status" by <a
Douglas Gregor</a> and <a href="../../people/dave_abrahams.htm">Dave Abrahams</a> href="../../people/peter_dimov.htm">Peter Dimov</a> because they are
contributed <tt>is_reference_wrapper</tt> and <tt>unwrap_reference</tt>. generally useful. <a href="../../people/doug_gregor.html">Douglas
</p> Gregor</a> and <a href="../../people/dave_abrahams.htm">Dave
<p><br> Abrahams</a> contributed <tt>is_reference_wrapper</tt> and
<br> <tt>unwrap_reference</tt>.
<br> </p>
<small>Copyright &copy; 2001 by Peter Dimov and Multi Media Ltd. Permission to
copy, use, modify, sell and distribute this document is granted provided this
copyright notice appears in all copies. This document is provided &quot;as <p><br><br><br><small>Copyright &copy; 2001 by Peter Dimov and Multi Media
is&quot; without express or implied warranty, and with no claim as to its Ltd. Permission to copy, use, modify, sell and distribute this document is
suitability for any purpose.</small></p> granted provided this copyright notice appears in all copies. This document
</body> is provided &quot;as is&quot; without express or implied warranty, and with
no claim as to its suitability for any purpose.</small></p>
</body>
</html> </html>