From 8df77f9cd0fcb9f3b6f3121460f4681380cff536 Mon Sep 17 00:00:00 2001 From: Tobias Schwinger Date: Sun, 13 May 2007 13:02:45 +0000 Subject: [PATCH] adds full support for pointer to member object type. [SVN r37683] --- .../function_types/detail/synthesize.hpp | 7 ++++ .../is_member_object_pointer.hpp | 7 ++-- .../function_types/member_object_pointer.hpp | 34 +++++++++++++++++++ 3 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 include/boost/function_types/member_object_pointer.hpp diff --git a/include/boost/function_types/detail/synthesize.hpp b/include/boost/function_types/detail/synthesize.hpp index 0ea91f1..0b15cbb 100644 --- a/include/boost/function_types/detail/synthesize.hpp +++ b/include/boost/function_types/detail/synthesize.hpp @@ -62,6 +62,13 @@ struct synthesize_mfp > { }; +template::type, + typename C = typename mpl::at_c::type> +struct synthesize_mop +{ + typedef R C::* type; +}; + #define BOOST_FT_variations BOOST_FT_function|BOOST_FT_member_pointer #define BOOST_FT_al_path boost/function_types/detail/synthesize_impl #include diff --git a/include/boost/function_types/is_member_object_pointer.hpp b/include/boost/function_types/is_member_object_pointer.hpp index 31b713c..fbf4850 100644 --- a/include/boost/function_types/is_member_object_pointer.hpp +++ b/include/boost/function_types/is_member_object_pointer.hpp @@ -18,12 +18,11 @@ namespace boost { namespace function_types { - template< typename T, typename Tag = null_tag > + template< typename T > struct is_member_object_pointer - : function_types::represents + : function_types::detail::represents_impl < function_types::components - , function_types::tag - > + , detail::member_object_pointer_tag > { BOOST_MPL_AUX_LAMBDA_SUPPORT(2,is_member_object_pointer,(T,Tag)) }; diff --git a/include/boost/function_types/member_object_pointer.hpp b/include/boost/function_types/member_object_pointer.hpp new file mode 100644 index 0000000..d0aa3f3 --- /dev/null +++ b/include/boost/function_types/member_object_pointer.hpp @@ -0,0 +1,34 @@ + +// (C) Copyright Tobias Schwinger +// +// Use modification and distribution are subject to the boost Software License, +// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). + +//------------------------------------------------------------------------------ + +#ifndef BOOST_FT_MEMBER_OBJECT_POINTER_HPP_INCLUDED +#define BOOST_FT_MEMBER_OBJECT_POINTER_HPP_INCLUDED + +#include +#include + +#include +#include + +namespace boost +{ + namespace function_types + { + template + struct member_object_pointer + : detail::synthesize_mop< typename detail::to_sequence::type > + { + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,member_object_pointer,(Types)) + }; + } + BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,function_types::member_object_pointer) +} + +#endif + +