X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=boost%2Fboost%2Fmem_fn.hpp;h=9695f57e80a7c529e23110b36829bd7fa65f9a60;hb=b01a9dc187d9cd396a57463ad27511379dcdc9cd;hp=f59fff41e1ce6620e7dc315a21d06299dec1ec25;hpb=59b6a4701a8d2b5155af08cf758b4ca120201282;p=lyx.git diff --git a/boost/boost/mem_fn.hpp b/boost/boost/mem_fn.hpp index f59fff41e1..9695f57e80 100644 --- a/boost/boost/mem_fn.hpp +++ b/boost/boost/mem_fn.hpp @@ -1,8 +1,10 @@ #ifndef BOOST_MEM_FN_HPP_INCLUDED #define BOOST_MEM_FN_HPP_INCLUDED -#if _MSC_VER+0 >= 1020 -#pragma once +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once #endif // @@ -10,29 +12,22 @@ // // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2001 David Abrahams +// Copyright (c) 2003-2005 Peter Dimov // -// 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. +// 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 +#include +#include namespace boost { -// get_pointer(p) extracts a ->* capable pointer from p - -template T * get_pointer(T * p) -{ - return p; -} - -// get_pointer(shared_ptr const & p) has been moved to shared_ptr.hpp - #if defined(BOOST_NO_VOID_RETURNS) #define BOOST_MEM_FN_CLASS_F , class F @@ -54,6 +49,18 @@ template struct mf #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 + +#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 @@ -66,6 +73,18 @@ template struct mf #endif +#ifdef BOOST_MEM_FN_ENABLE_FASTCALL + +#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall +#define BOOST_MEM_FN_CC __fastcall + +#include + +#undef BOOST_MEM_FN_CC +#undef BOOST_MEM_FN_NAME + +#endif + #undef BOOST_MEM_FN_RETURN }; // struct mf @@ -83,6 +102,18 @@ template<> struct mf #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 + +#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 @@ -95,6 +126,18 @@ template<> struct mf #endif +#ifdef BOOST_MEM_FN_ENABLE_FASTCALL + +#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall +#define BOOST_MEM_FN_CC __fastcall + +#include + +#undef BOOST_MEM_FN_CC +#undef BOOST_MEM_FN_NAME + +#endif + #undef BOOST_MEM_FN_RETURN }; // struct mf @@ -112,6 +155,20 @@ template<> struct mf #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 + +#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 @@ -126,6 +183,20 @@ template<> struct mf #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 + +#undef BOOST_MEM_FN_NAME +#undef BOOST_MEM_FN_NAME2 +#undef BOOST_MEM_FN_CC + +#endif + } // namespace _mfi #else // #ifdef BOOST_NO_VOID_RETURNS @@ -146,6 +217,18 @@ namespace _mfi #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 + +#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 @@ -158,6 +241,18 @@ namespace _mfi #endif +#ifdef BOOST_MEM_FN_ENABLE_FASTCALL + +#define BOOST_MEM_FN_NAME(X) X##_fastcall +#define BOOST_MEM_FN_CC __fastcall + +#include + +#undef BOOST_MEM_FN_CC +#undef BOOST_MEM_FN_NAME + +#endif + #undef BOOST_MEM_FN_RETURN } // namespace _mfi @@ -175,6 +270,18 @@ namespace _mfi #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 + +#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 @@ -187,6 +294,18 @@ namespace _mfi #endif +#ifdef BOOST_MEM_FN_ENABLE_FASTCALL + +#define BOOST_MEM_FN_NAME(X) X##_fastcall +#define BOOST_MEM_FN_CC __fastcall + +#include + +#undef BOOST_MEM_FN_NAME +#undef BOOST_MEM_FN_CC + +#endif + // data member support namespace _mfi @@ -209,11 +328,6 @@ private: return (u.*f_); } - template R & call(U & u, T *) const - { - return (u.*f_); - } - template R const & call(U & u, void const *) const { return (get_pointer(u)->*f_); @@ -233,24 +347,34 @@ public: return (p->*f_); } - template R const & operator()(U & u) const + template R const & operator()(U const & u) const { return call(u, &u); } -#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1300) +#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, < 0x3200) R & operator()(T & t) const { return (t.*f_); } -#endif - 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