Skip to content

Commit

Permalink
Eliminate mem_fn_cc.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Jan 4, 2024
1 parent 5cef4e4 commit 5b21804
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 65 deletions.
94 changes: 56 additions & 38 deletions include/boost/bind/mem_fn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,63 +89,81 @@ template<class Pm, class R, class T, class... A> class mf

//

#define BOOST_MEM_FN_NAME(X) X
#define BOOST_MEM_FN_CC
#define BOOST_MEM_FN_NOEXCEPT
template<class R, class T, class... A>
auto mem_fn( R (T::*pmf) (A...) ) -> _mfi::mf<decltype(pmf), R, T, A...>
{
return pmf;
}

#include <boost/bind/mem_fn_cc.hpp>
template<class R, class T, class... A>
auto mem_fn( R (T::*pmf) (A...) const ) -> _mfi::mf<decltype(pmf), R, T, A...>
{
return pmf;
}

#if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
# undef BOOST_MEM_FN_NOEXCEPT
# define BOOST_MEM_FN_NOEXCEPT noexcept
# include <boost/bind/mem_fn_cc.hpp>
#endif

#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NOEXCEPT
template<class R, class T, class... A>
auto mem_fn( R (T::*pmf) (A...) noexcept ) -> _mfi::mf<decltype(pmf), R, T, A...>
{
return pmf;
}

#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
template<class R, class T, class... A>
auto mem_fn( R (T::*pmf) (A...) const noexcept ) -> _mfi::mf<decltype(pmf), R, T, A...>
{
return pmf;
}

#define BOOST_MEM_FN_NAME(X) X##_cdecl
#define BOOST_MEM_FN_CC __cdecl
#define BOOST_MEM_FN_NOEXCEPT
#endif // #if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )

#include <boost/bind/mem_fn_cc.hpp>
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)

#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NOEXCEPT
template<class R, class T, class... A>
auto mem_fn( R (__cdecl T::*pmf) (A...) ) -> _mfi::mf<decltype(pmf), R, T, A...>
{
return pmf;
}

#endif
template<class R, class T, class... A>
auto mem_fn( R (__cdecl T::*pmf) (A...) const ) -> _mfi::mf<decltype(pmf), R, T, A...>
{
return pmf;
}

#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
#endif // #if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)

#define BOOST_MEM_FN_NAME(X) X##_stdcall
#define BOOST_MEM_FN_CC __stdcall
#define BOOST_MEM_FN_NOEXCEPT
#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)

#include <boost/bind/mem_fn_cc.hpp>
template<class R, class T, class... A>
auto mem_fn( R (__stdcall T::*pmf) (A...) ) -> _mfi::mf<decltype(pmf), R, T, A...>
{
return pmf;
}

#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NOEXCEPT
template<class R, class T, class... A>
auto mem_fn( R (__stdcall T::*pmf) (A...) const ) -> _mfi::mf<decltype(pmf), R, T, A...>
{
return pmf;
}

#endif
#endif // #if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)

#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)

#define BOOST_MEM_FN_NAME(X) X##_fastcall
#define BOOST_MEM_FN_CC __fastcall
#define BOOST_MEM_FN_NOEXCEPT

#include <boost/bind/mem_fn_cc.hpp>
template<class R, class T, class... A>
auto mem_fn( R (__fastcall T::*pmf) (A...) ) -> _mfi::mf<decltype(pmf), R, T, A...>
{
return pmf;
}

#undef BOOST_MEM_FN_NAME
#undef BOOST_MEM_FN_CC
#undef BOOST_MEM_FN_NOEXCEPT
template<class R, class T, class... A>
auto mem_fn( R (__fastcall T::*pmf) (A...) const ) -> _mfi::mf<decltype(pmf), R, T, A...>
{
return pmf;
}

#endif
#endif // #if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)

// data member support

Expand Down
27 changes: 0 additions & 27 deletions include/boost/bind/mem_fn_cc.hpp

This file was deleted.

0 comments on commit 5b21804

Please sign in to comment.