]> git.lyx.org Git - features.git/blobdiff - boost/boost/bind/mem_fn.hpp
boost: add eol property
[features.git] / boost / boost / bind / mem_fn.hpp
index 86c61e4bdbed4fc3ef20380c9476110c9f994d82..956e7d88853c6c30ab700086a1df487dec42e8ee 100644 (file)
-#ifndef BOOST_BIND_MEM_FN_HPP_INCLUDED\r
-#define BOOST_BIND_MEM_FN_HPP_INCLUDED\r
-\r
-// MS compatible compilers support #pragma once\r
-\r
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
-# pragma once\r
-#endif\r
-\r
-//\r
-//  mem_fn.hpp - a generalization of std::mem_fun[_ref]\r
-//\r
-//  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.\r
-//  Copyright (c) 2001 David Abrahams\r
-//  Copyright (c) 2003-2005 Peter Dimov\r
-//\r
-// Distributed under the Boost Software License, Version 1.0. (See\r
-// accompanying file LICENSE_1_0.txt or copy at\r
-// http://www.boost.org/LICENSE_1_0.txt)\r
-//\r
-//  See http://www.boost.org/libs/bind/mem_fn.html for documentation.\r
-//\r
-\r
-#include <boost/config.hpp>\r
-#include <boost/get_pointer.hpp>\r
-#include <boost/detail/workaround.hpp>\r
-\r
-namespace boost\r
-{\r
-\r
-#if defined(BOOST_NO_VOID_RETURNS)\r
-\r
-#define BOOST_MEM_FN_CLASS_F , class F\r
-#define BOOST_MEM_FN_TYPEDEF(X)\r
-\r
-namespace _mfi // mem_fun_impl\r
-{\r
-\r
-template<class V> struct mf\r
-{\r
-\r
-#define BOOST_MEM_FN_RETURN return\r
-\r
-#define BOOST_MEM_FN_NAME(X) inner_##X\r
-#define BOOST_MEM_FN_CC\r
-\r
-#include <boost/bind/mem_fn_template.hpp>\r
-\r
-#undef BOOST_MEM_FN_CC\r
-#undef BOOST_MEM_FN_NAME\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_CDECL\r
-\r
-#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl\r
-#define BOOST_MEM_FN_CC __cdecl\r
-\r
-#include <boost/bind/mem_fn_template.hpp>\r
-\r
-#undef BOOST_MEM_FN_CC\r
-#undef BOOST_MEM_FN_NAME\r
-\r
-#endif\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_STDCALL\r
-\r
-#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall\r
-#define BOOST_MEM_FN_CC __stdcall\r
-\r
-#include <boost/bind/mem_fn_template.hpp>\r
-\r
-#undef BOOST_MEM_FN_CC\r
-#undef BOOST_MEM_FN_NAME\r
-\r
-#endif\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_FASTCALL\r
-\r
-#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall\r
-#define BOOST_MEM_FN_CC __fastcall\r
-\r
-#include <boost/bind/mem_fn_template.hpp>\r
-\r
-#undef BOOST_MEM_FN_CC\r
-#undef BOOST_MEM_FN_NAME\r
-\r
-#endif\r
-\r
-#undef BOOST_MEM_FN_RETURN\r
-\r
-}; // struct mf<V>\r
-\r
-template<> struct mf<void>\r
-{\r
-\r
-#define BOOST_MEM_FN_RETURN\r
-\r
-#define BOOST_MEM_FN_NAME(X) inner_##X\r
-#define BOOST_MEM_FN_CC\r
-\r
-#include <boost/bind/mem_fn_template.hpp>\r
-\r
-#undef BOOST_MEM_FN_CC\r
-#undef BOOST_MEM_FN_NAME\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_CDECL\r
-\r
-#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl\r
-#define BOOST_MEM_FN_CC __cdecl\r
-\r
-#include <boost/bind/mem_fn_template.hpp>\r
-\r
-#undef BOOST_MEM_FN_CC\r
-#undef BOOST_MEM_FN_NAME\r
-\r
-#endif\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_STDCALL\r
-\r
-#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall\r
-#define BOOST_MEM_FN_CC __stdcall\r
-\r
-#include <boost/bind/mem_fn_template.hpp>\r
-\r
-#undef BOOST_MEM_FN_CC\r
-#undef BOOST_MEM_FN_NAME\r
-\r
-#endif\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_FASTCALL\r
-\r
-#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall\r
-#define BOOST_MEM_FN_CC __fastcall\r
-\r
-#include <boost/bind/mem_fn_template.hpp>\r
-\r
-#undef BOOST_MEM_FN_CC\r
-#undef BOOST_MEM_FN_NAME\r
-\r
-#endif\r
-\r
-#undef BOOST_MEM_FN_RETURN\r
-\r
-}; // struct mf<void>\r
-\r
-#undef BOOST_MEM_FN_CLASS_F\r
-#undef BOOST_MEM_FN_TYPEDEF_F\r
-\r
-#define BOOST_MEM_FN_NAME(X) X\r
-#define BOOST_MEM_FN_NAME2(X) inner_##X\r
-#define BOOST_MEM_FN_CC\r
-\r
-#include <boost/bind/mem_fn_vw.hpp>\r
-\r
-#undef BOOST_MEM_FN_NAME\r
-#undef BOOST_MEM_FN_NAME2\r
-#undef BOOST_MEM_FN_CC\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_CDECL\r
-\r
-#define BOOST_MEM_FN_NAME(X) X##_cdecl\r
-#define BOOST_MEM_FN_NAME2(X) inner_##X##_cdecl\r
-#define BOOST_MEM_FN_CC __cdecl\r
-\r
-#include <boost/bind/mem_fn_vw.hpp>\r
-\r
-#undef BOOST_MEM_FN_NAME\r
-#undef BOOST_MEM_FN_NAME2\r
-#undef BOOST_MEM_FN_CC\r
-\r
-#endif\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_STDCALL\r
-\r
-#define BOOST_MEM_FN_NAME(X) X##_stdcall\r
-#define BOOST_MEM_FN_NAME2(X) inner_##X##_stdcall\r
-#define BOOST_MEM_FN_CC __stdcall\r
-\r
-#include <boost/bind/mem_fn_vw.hpp>\r
-\r
-#undef BOOST_MEM_FN_NAME\r
-#undef BOOST_MEM_FN_NAME2\r
-#undef BOOST_MEM_FN_CC\r
-\r
-#endif\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_FASTCALL\r
-\r
-#define BOOST_MEM_FN_NAME(X) X##_fastcall\r
-#define BOOST_MEM_FN_NAME2(X) inner_##X##_fastcall\r
-#define BOOST_MEM_FN_CC __fastcall\r
-\r
-#include <boost/bind/mem_fn_vw.hpp>\r
-\r
-#undef BOOST_MEM_FN_NAME\r
-#undef BOOST_MEM_FN_NAME2\r
-#undef BOOST_MEM_FN_CC\r
-\r
-#endif\r
-\r
-} // namespace _mfi\r
-\r
-#else // #ifdef BOOST_NO_VOID_RETURNS\r
-\r
-#define BOOST_MEM_FN_CLASS_F\r
-#define BOOST_MEM_FN_TYPEDEF(X) typedef X;\r
-\r
-namespace _mfi\r
-{\r
-\r
-#define BOOST_MEM_FN_RETURN return\r
-\r
-#define BOOST_MEM_FN_NAME(X) X\r
-#define BOOST_MEM_FN_CC\r
-\r
-#include <boost/bind/mem_fn_template.hpp>\r
-\r
-#undef BOOST_MEM_FN_CC\r
-#undef BOOST_MEM_FN_NAME\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_CDECL\r
-\r
-#define BOOST_MEM_FN_NAME(X) X##_cdecl\r
-#define BOOST_MEM_FN_CC __cdecl\r
-\r
-#include <boost/bind/mem_fn_template.hpp>\r
-\r
-#undef BOOST_MEM_FN_CC\r
-#undef BOOST_MEM_FN_NAME\r
-\r
-#endif\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_STDCALL\r
-\r
-#define BOOST_MEM_FN_NAME(X) X##_stdcall\r
-#define BOOST_MEM_FN_CC __stdcall\r
-\r
-#include <boost/bind/mem_fn_template.hpp>\r
-\r
-#undef BOOST_MEM_FN_CC\r
-#undef BOOST_MEM_FN_NAME\r
-\r
-#endif\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_FASTCALL\r
-\r
-#define BOOST_MEM_FN_NAME(X) X##_fastcall\r
-#define BOOST_MEM_FN_CC __fastcall\r
-\r
-#include <boost/bind/mem_fn_template.hpp>\r
-\r
-#undef BOOST_MEM_FN_CC\r
-#undef BOOST_MEM_FN_NAME\r
-\r
-#endif\r
-\r
-#undef BOOST_MEM_FN_RETURN\r
-\r
-} // namespace _mfi\r
-\r
-#undef BOOST_MEM_FN_CLASS_F\r
-#undef BOOST_MEM_FN_TYPEDEF\r
-\r
-#endif // #ifdef BOOST_NO_VOID_RETURNS\r
-\r
-#define BOOST_MEM_FN_NAME(X) X\r
-#define BOOST_MEM_FN_CC\r
-\r
-#include <boost/bind/mem_fn_cc.hpp>\r
-\r
-#undef BOOST_MEM_FN_NAME\r
-#undef BOOST_MEM_FN_CC\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_CDECL\r
-\r
-#define BOOST_MEM_FN_NAME(X) X##_cdecl\r
-#define BOOST_MEM_FN_CC __cdecl\r
-\r
-#include <boost/bind/mem_fn_cc.hpp>\r
-\r
-#undef BOOST_MEM_FN_NAME\r
-#undef BOOST_MEM_FN_CC\r
-\r
-#endif\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_STDCALL\r
-\r
-#define BOOST_MEM_FN_NAME(X) X##_stdcall\r
-#define BOOST_MEM_FN_CC __stdcall\r
-\r
-#include <boost/bind/mem_fn_cc.hpp>\r
-\r
-#undef BOOST_MEM_FN_NAME\r
-#undef BOOST_MEM_FN_CC\r
-\r
-#endif\r
-\r
-#ifdef BOOST_MEM_FN_ENABLE_FASTCALL\r
-\r
-#define BOOST_MEM_FN_NAME(X) X##_fastcall\r
-#define BOOST_MEM_FN_CC __fastcall\r
-\r
-#include <boost/bind/mem_fn_cc.hpp>\r
-\r
-#undef BOOST_MEM_FN_NAME\r
-#undef BOOST_MEM_FN_CC\r
-\r
-#endif\r
-\r
-// data member support\r
-\r
-namespace _mfi\r
-{\r
-\r
-template<class R, class T> class dm\r
-{\r
-public:\r
-\r
-    typedef R const & result_type;\r
-    typedef T const * argument_type;\r
-\r
-private:\r
-    \r
-    typedef R (T::*F);\r
-    F f_;\r
-\r
-    template<class U> R const & call(U & u, T const *) const\r
-    {\r
-        return (u.*f_);\r
-    }\r
-\r
-    template<class U> R const & call(U & u, void const *) const\r
-    {\r
-        return (get_pointer(u)->*f_);\r
-    }\r
-\r
-public:\r
-    \r
-    explicit dm(F f): f_(f) {}\r
-\r
-    R & operator()(T * p) const\r
-    {\r
-        return (p->*f_);\r
-    }\r
-\r
-    R const & operator()(T const * p) const\r
-    {\r
-        return (p->*f_);\r
-    }\r
-\r
-    template<class U> R const & operator()(U const & u) const\r
-    {\r
-        return call(u, &u);\r
-    }\r
-\r
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, < 0x3200)\r
-\r
-    R & operator()(T & t) const\r
-    {\r
-        return (t.*f_);\r
-    }\r
-\r
-    R const & operator()(T const & t) const\r
-    {\r
-        return (t.*f_);\r
-    }\r
-\r
-#endif\r
-\r
-    bool operator==(dm const & rhs) const\r
-    {\r
-        return f_ == rhs.f_;\r
-    }\r
-\r
-    bool operator!=(dm const & rhs) const\r
-    {\r
-        return f_ != rhs.f_;\r
-    }\r
-};\r
-\r
-} // namespace _mfi\r
-\r
-template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f)\r
-{\r
-    return _mfi::dm<R, T>(f);\r
-}\r
-\r
-} // namespace boost\r
-\r
-#endif // #ifndef BOOST_BIND_MEM_FN_HPP_INCLUDED\r
+#ifndef BOOST_BIND_MEM_FN_HPP_INCLUDED
+#define BOOST_BIND_MEM_FN_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+//  mem_fn.hpp - a generalization of std::mem_fun[_ref]
+//
+//  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
+//  Copyright (c) 2001 David Abrahams
+//  Copyright (c) 2003-2005 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+//  See http://www.boost.org/libs/bind/mem_fn.html for documentation.
+//
+
+#include <boost/config.hpp>
+#include <boost/get_pointer.hpp>
+#include <boost/detail/workaround.hpp>
+
+namespace boost
+{
+
+#if defined(BOOST_NO_VOID_RETURNS)
+
+#define BOOST_MEM_FN_CLASS_F , class F
+#define BOOST_MEM_FN_TYPEDEF(X)
+
+namespace _mfi // mem_fun_impl
+{
+
+template<class V> struct mf
+{
+
+#define BOOST_MEM_FN_RETURN return
+
+#define BOOST_MEM_FN_NAME(X) inner_##X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#ifdef BOOST_MEM_FN_ENABLE_CDECL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl
+#define BOOST_MEM_FN_CC __cdecl
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall
+#define BOOST_MEM_FN_CC __fastcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#undef BOOST_MEM_FN_RETURN
+
+}; // struct mf<V>
+
+template<> struct mf<void>
+{
+
+#define BOOST_MEM_FN_RETURN
+
+#define BOOST_MEM_FN_NAME(X) inner_##X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#ifdef BOOST_MEM_FN_ENABLE_CDECL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl
+#define BOOST_MEM_FN_CC __cdecl
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall
+#define BOOST_MEM_FN_CC __fastcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#undef BOOST_MEM_FN_RETURN
+
+}; // 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
+
+#include <boost/bind/mem_fn_vw.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_NAME2
+#undef BOOST_MEM_FN_CC
+
+#ifdef BOOST_MEM_FN_ENABLE_CDECL
+
+#define BOOST_MEM_FN_NAME(X) X##_cdecl
+#define BOOST_MEM_FN_NAME2(X) inner_##X##_cdecl
+#define BOOST_MEM_FN_CC __cdecl
+
+#include <boost/bind/mem_fn_vw.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_NAME2
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_stdcall
+#define BOOST_MEM_FN_NAME2(X) inner_##X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_vw.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_NAME2
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_fastcall
+#define BOOST_MEM_FN_NAME2(X) inner_##X##_fastcall
+#define BOOST_MEM_FN_CC __fastcall
+
+#include <boost/bind/mem_fn_vw.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_NAME2
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+} // namespace _mfi
+
+#else // #ifdef BOOST_NO_VOID_RETURNS
+
+#define BOOST_MEM_FN_CLASS_F
+#define BOOST_MEM_FN_TYPEDEF(X) typedef X;
+
+namespace _mfi
+{
+
+#define BOOST_MEM_FN_RETURN return
+
+#define BOOST_MEM_FN_NAME(X) X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#ifdef BOOST_MEM_FN_ENABLE_CDECL
+
+#define BOOST_MEM_FN_NAME(X) X##_cdecl
+#define BOOST_MEM_FN_CC __cdecl
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_fastcall
+#define BOOST_MEM_FN_CC __fastcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#undef BOOST_MEM_FN_RETURN
+
+} // 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
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_cc.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_CC
+
+#ifdef BOOST_MEM_FN_ENABLE_CDECL
+
+#define BOOST_MEM_FN_NAME(X) X##_cdecl
+#define BOOST_MEM_FN_CC __cdecl
+
+#include <boost/bind/mem_fn_cc.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_cc.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_fastcall
+#define BOOST_MEM_FN_CC __fastcall
+
+#include <boost/bind/mem_fn_cc.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_CC
+
+#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 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 const & u) const
+    {
+        return call(u, &u);
+    }
+
+#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, < 0x3200)
+
+    R & operator()(T & t) const
+    {
+        return (t.*f_);
+    }
+
+    R const & operator()(T const & t) const
+    {
+        return (t.*f_);
+    }
+
+#endif
+
+    bool operator==(dm const & rhs) const
+    {
+        return f_ == rhs.f_;
+    }
+
+    bool operator!=(dm const & rhs) const
+    {
+        return f_ != rhs.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
+
+#endif // #ifndef BOOST_BIND_MEM_FN_HPP_INCLUDED