update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -0,0 +1,85 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_CLASS_HPP)
#define BOOST_TTI_DETAIL_CLASS_HPP
#include <boost/mpl/and.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/detail/ddeftype.hpp>
#include <boost/tti/detail/dlambda.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/type_traits/is_class.hpp>
#define BOOST_TTI_DETAIL_TRAIT_INVOKE_HAS_CLASS(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_MFC> \
struct BOOST_PP_CAT(trait,_detail_class_invoke) \
{ \
BOOST_MPL_ASSERT((BOOST_TTI_NAMESPACE::detail::is_lambda_expression<BOOST_TTI_DETAIL_TP_MFC>)); \
typedef typename boost::mpl::apply<BOOST_TTI_DETAIL_TP_MFC,typename BOOST_TTI_DETAIL_TP_T::name>::type type; \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_CLASS_OP_CHOOSE(trait,name) \
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(BOOST_PP_CAT(trait,_detail_class_mpl), name, false) \
BOOST_TTI_DETAIL_TRAIT_INVOKE_HAS_CLASS(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U,class BOOST_TTI_DETAIL_TP_B> \
struct BOOST_PP_CAT(trait,_detail_class_op_choose) : \
boost::mpl::and_ \
< \
boost::is_class<typename BOOST_TTI_DETAIL_TP_T::name>, \
BOOST_PP_CAT(trait,_detail_class_invoke)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_U> \
> \
{ \
}; \
\
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U> \
struct BOOST_PP_CAT(trait,_detail_class_op_choose)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_U,boost::mpl::false_::type> : \
boost::mpl::false_ \
{ \
}; \
\
template<class BOOST_TTI_DETAIL_TP_T> \
struct BOOST_PP_CAT(trait,_detail_class_op_choose)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_NAMESPACE::detail::deftype,boost::mpl::true_::type> : \
boost::is_class<typename BOOST_TTI_DETAIL_TP_T::name> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_CLASS_OP(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_CLASS_OP_CHOOSE(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U> \
struct BOOST_PP_CAT(trait,_detail_class_op) : \
BOOST_PP_CAT(trait,_detail_class_op_choose) \
< \
BOOST_TTI_DETAIL_TP_T, \
BOOST_TTI_DETAIL_TP_U, \
typename BOOST_PP_CAT(trait,_detail_class_mpl)<BOOST_TTI_DETAIL_TP_T>::type \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_CLASS(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_CLASS_OP(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U> \
struct BOOST_PP_CAT(trait,_detail_class) : \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_class_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_U>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
#endif // BOOST_TTI_DETAIL_CLASS_HPP

View File

@@ -7,17 +7,15 @@
#if !defined(BOOST_TTI_DETAIL_COMP_MEM_FUN_HPP)
#define BOOST_TTI_DETAIL_COMP_MEM_FUN_HPP
#include <boost/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/detail/dftclass.hpp>
#include <boost/tti/detail/dmacro_sunfix.hpp>
#include <boost/tti/detail/dnullptr.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#if defined(__SUNPRO_CC)
#define BOOST_TTI_DETAIL_TRAIT_HAS_COMP_MEMBER_FUNCTION(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T> \
struct BOOST_PP_CAT(trait,_detail_hcmf) \
@@ -32,7 +30,7 @@
}; \
\
template<BOOST_TTI_DETAIL_TP_T> \
struct helper {}; \
struct helper BOOST_TTI_DETAIL_MACRO_SUNFIX ; \
\
template<class BOOST_TTI_DETAIL_TP_U> \
static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_U::name> *); \
@@ -44,35 +42,4 @@
}; \
/**/
#else
#define BOOST_TTI_DETAIL_TRAIT_HAS_COMP_MEMBER_FUNCTION(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T> \
struct BOOST_PP_CAT(trait,_detail_hcmf) \
{ \
template<class BOOST_TTI_DETAIL_TP_F> \
struct cl_type : \
boost::remove_const \
< \
typename BOOST_TTI_NAMESPACE::detail::class_type<BOOST_TTI_DETAIL_TP_F>::type \
> \
{ \
}; \
\
template<BOOST_TTI_DETAIL_TP_T> \
struct helper; \
\
template<class BOOST_TTI_DETAIL_TP_U> \
static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_U::name> *); \
\
template<class BOOST_TTI_DETAIL_TP_U> \
static ::boost::type_traits::no_type chkt(...); \
\
typedef boost::mpl::bool_<sizeof(chkt<typename cl_type<BOOST_TTI_DETAIL_TP_T>::type>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)> type; \
}; \
/**/
#endif
#endif // BOOST_TTI_DETAIL_COMP_MEM_FUN_HPP

View File

@@ -0,0 +1,46 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_COMP_MEM_FUN_TEMPLATE_HPP)
#define BOOST_TTI_DETAIL_COMP_MEM_FUN_TEMPLATE_HPP
#include <boost/mpl/bool.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/array/enum.hpp>
#include <boost/tti/detail/dftclass.hpp>
#include <boost/tti/detail/dnullptr.hpp>
#include <boost/tti/detail/dmacro_sunfix.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#define BOOST_TTI_DETAIL_TRAIT_HAS_COMP_MEMBER_FUNCTION_TEMPLATE(trait,name,tparray) \
template<class BOOST_TTI_DETAIL_TP_T> \
struct BOOST_PP_CAT(trait,_detail_hcmft) \
{ \
template<class BOOST_TTI_DETAIL_TP_F> \
struct cl_type : \
boost::remove_const \
< \
typename BOOST_TTI_NAMESPACE::detail::class_type<BOOST_TTI_DETAIL_TP_F>::type \
> \
{ \
}; \
\
template<BOOST_TTI_DETAIL_TP_T> \
struct helper BOOST_TTI_DETAIL_MACRO_SUNFIX ; \
\
template<class BOOST_TTI_DETAIL_TP_U> \
static ::boost::type_traits::yes_type check(helper<&BOOST_TTI_DETAIL_TP_U::template name<BOOST_PP_ARRAY_ENUM(tparray)> > *); \
\
template<class BOOST_TTI_DETAIL_TP_U> \
static ::boost::type_traits::no_type check(...); \
\
typedef boost::mpl::bool_<sizeof(check<typename cl_type<BOOST_TTI_DETAIL_TP_T>::type>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)> type; \
}; \
/**/
#endif // BOOST_TTI_DETAIL_COMP_MEM_FUN_TEMPLATE_HPP

View File

@@ -18,10 +18,10 @@
template<class BOOST_TTI_DETAIL_TP_ET,class BOOST_TTI_DETAIL_TP_DT> \
struct BOOST_PP_CAT(trait,_detail_hd) : \
boost::mpl::or_ \
< \
BOOST_PP_CAT(trait,_detail_hmd_with_enclosing_class)<BOOST_TTI_DETAIL_TP_ET,BOOST_TTI_DETAIL_TP_DT>, \
BOOST_PP_CAT(trait,_detail_hsd)<BOOST_TTI_DETAIL_TP_ET,BOOST_TTI_DETAIL_TP_DT> \
> \
< \
BOOST_PP_CAT(trait,_detail_hmd_with_enclosing_class)<BOOST_TTI_DETAIL_TP_ET,BOOST_TTI_DETAIL_TP_DT>, \
BOOST_PP_CAT(trait,_detail_hsd)<BOOST_TTI_DETAIL_TP_ET,BOOST_TTI_DETAIL_TP_DT> \
> \
{ \
}; \
/**/

View File

@@ -0,0 +1,36 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_ENCLOSING_TYPE_HPP)
#define BOOST_TTI_DETAIL_ENCLOSING_TYPE_HPP
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_union.hpp>
namespace boost
{
namespace tti
{
namespace detail
{
template
<
class BOOST_TTI_DETAIL_TP_T
>
struct enclosing_type :
boost::mpl::or_
<
boost::is_class<BOOST_TTI_DETAIL_TP_T>,
boost::is_union<BOOST_TTI_DETAIL_TP_T>
>
{
};
}
}
}
#endif // BOOST_TTI_DETAIL_ENCLOSING_TYPE_HPP

View File

@@ -0,0 +1,85 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_ENUM_HPP)
#define BOOST_TTI_DETAIL_ENUM_HPP
#include <boost/mpl/and.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/detail/ddeftype.hpp>
#include <boost/tti/detail/dlambda.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/type_traits/is_enum.hpp>
#define BOOST_TTI_DETAIL_TRAIT_INVOKE_HAS_ENUM(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_MFC> \
struct BOOST_PP_CAT(trait,_detail_enum_invoke) \
{ \
BOOST_MPL_ASSERT((BOOST_TTI_NAMESPACE::detail::is_lambda_expression<BOOST_TTI_DETAIL_TP_MFC>)); \
typedef typename boost::mpl::apply<BOOST_TTI_DETAIL_TP_MFC,typename BOOST_TTI_DETAIL_TP_T::name>::type type; \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_ENUM_OP_CHOOSE(trait,name) \
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(BOOST_PP_CAT(trait,_detail_enum_mpl), name, false) \
BOOST_TTI_DETAIL_TRAIT_INVOKE_HAS_ENUM(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U,class BOOST_TTI_DETAIL_TP_B> \
struct BOOST_PP_CAT(trait,_detail_enum_op_choose) : \
boost::mpl::and_ \
< \
boost::is_enum<typename BOOST_TTI_DETAIL_TP_T::name>, \
BOOST_PP_CAT(trait,_detail_enum_invoke)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_U> \
> \
{ \
}; \
\
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U> \
struct BOOST_PP_CAT(trait,_detail_enum_op_choose)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_U,boost::mpl::false_::type> : \
boost::mpl::false_ \
{ \
}; \
\
template<class BOOST_TTI_DETAIL_TP_T> \
struct BOOST_PP_CAT(trait,_detail_enum_op_choose)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_NAMESPACE::detail::deftype,boost::mpl::true_::type> : \
boost::is_enum<typename BOOST_TTI_DETAIL_TP_T::name> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_ENUM_OP(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_ENUM_OP_CHOOSE(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U> \
struct BOOST_PP_CAT(trait,_detail_enum_op) : \
BOOST_PP_CAT(trait,_detail_enum_op_choose) \
< \
BOOST_TTI_DETAIL_TP_T, \
BOOST_TTI_DETAIL_TP_U, \
typename BOOST_PP_CAT(trait,_detail_enum_mpl)<BOOST_TTI_DETAIL_TP_T>::type \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_ENUM(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_ENUM_OP(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U> \
struct BOOST_PP_CAT(trait,_detail_enum) : \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_enum_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_U>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
#endif // BOOST_TTI_DETAIL_ENUM_HPP

View File

@@ -1,5 +1,5 @@
// (C) Copyright Edward Diener 2012,2013
// (C) Copyright Edward Diener 2012,2013,2019
// Use, modification and distribution are subject to 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).
@@ -7,26 +7,58 @@
#if !defined(BOOST_TTI_DETAIL_FUNCTION_HPP)
#define BOOST_TTI_DETAIL_FUNCTION_HPP
#include <boost/mpl/and.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/detail/dmem_fun.hpp>
#include <boost/tti/detail/dstatic_mem_fun.hpp>
#include <boost/tti/detail/dtfunction.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/detail/dstatic_function_tags.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_STATIC_CALL(trait,name) \
BOOST_TTI_DETAIL_TRAIT_IMPL_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hfsc) : \
BOOST_PP_CAT(trait,_detail_ihsmf) \
< \
BOOST_TTI_DETAIL_TP_T, \
typename BOOST_TTI_NAMESPACE::detail::tfunction_seq<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>::type \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_STATIC(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_STATIC_CALL(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hfs) : \
boost::mpl::eval_if \
< \
boost::mpl::and_ \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_TTI_NAMESPACE::detail::static_function_tag<BOOST_TTI_DETAIL_TP_TAG> \
>, \
BOOST_PP_CAT(trait,_detail_hfsc)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \
BOOST_TTI_DETAIL_TRAIT_IMPL_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_STATIC(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hf) : \
boost::mpl::or_ \
< \
BOOST_PP_CAT(trait,_detail_call_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
BOOST_PP_CAT(trait,_detail_ihsmf) \
< \
BOOST_TTI_DETAIL_TP_T, \
typename BOOST_TTI_NAMESPACE::detail::tfunction_seq<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>::type \
> \
> \
< \
BOOST_PP_CAT(trait,_detail_hmf_call_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
BOOST_PP_CAT(trait,_detail_hfs)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \
> \
{ \
}; \
/**/

View File

@@ -0,0 +1,66 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_FUNCTION_TEMPLATE_HPP)
#define BOOST_TTI_DETAIL_FUNCTION_TEMPLATE_HPP
#include <boost/mpl/and.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/detail/dmem_fun_template.hpp>
#include <boost/tti/detail/dstatic_mem_fun_template.hpp>
#include <boost/tti/detail/dtfunction.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/detail/dstatic_function_tags.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_TEMPLATE_STATIC_CALL(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_IMPL_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hftsc) : \
BOOST_PP_CAT(trait,_detail_ihsmft) \
< \
BOOST_TTI_DETAIL_TP_T, \
typename BOOST_TTI_NAMESPACE::detail::tfunction_seq<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>::type \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_TEMPLATE_STATIC(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_TEMPLATE_STATIC_CALL(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hfts) : \
boost::mpl::eval_if \
< \
boost::mpl::and_ \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_TTI_NAMESPACE::detail::static_function_tag<BOOST_TTI_DETAIL_TP_TAG> \
>, \
BOOST_PP_CAT(trait,_detail_hftsc)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_TEMPLATE(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_TEMPLATE_STATIC(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hft) : \
boost::mpl::or_ \
< \
BOOST_PP_CAT(trait,_detail_hmft_call_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
BOOST_PP_CAT(trait,_detail_hfts)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \
> \
{ \
}; \
/**/
#endif // BOOST_TTI_DETAIL_FUNCTION_TEMPLATE_HPP

View File

@@ -0,0 +1,40 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_MACRO_FUN_TEMPLATE_HPP)
#define BOOST_TTI_DETAIL_MACRO_FUN_TEMPLATE_HPP
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/logical/and.hpp>
#include <boost/preprocessor/variadic/elem.hpp>
#include <boost/preprocessor/variadic/size.hpp>
#include <boost/preprocessor/variadic/to_array.hpp>
#include <boost/preprocessor/detail/is_binary.hpp>
#include <boost/tti/detail/dmacro_fve.hpp>
#define BOOST_TTI_DETAIL_FUN_TEMPLATE_VARIADIC_TO_ARRAY(...) \
BOOST_PP_IIF \
( \
BOOST_PP_AND \
( \
BOOST_PP_EQUAL \
( \
BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), \
1 \
), \
BOOST_PP_IS_BINARY \
( \
BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__) \
) \
), \
BOOST_TTI_DETAIL_FIRST_VARIADIC_ELEM, \
BOOST_PP_VARIADIC_TO_ARRAY \
) \
(__VA_ARGS__) \
/**/
#endif // BOOST_TTI_DETAIL_MACRO_FUN_TEMPLATE_HPP

View File

@@ -0,0 +1,16 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_MACRO_FVE_HPP)
#define BOOST_TTI_DETAIL_MACRO_FVE_HPP
#include <boost/preprocessor/variadic/elem.hpp>
#define BOOST_TTI_DETAIL_FIRST_VARIADIC_ELEM(...) \
BOOST_PP_VARIADIC_ELEM(0,__VA_ARGS__) \
/**/
#endif // BOOST_TTI_DETAIL_MACRO_FVE_HPP

View File

@@ -0,0 +1,20 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_MACRO_SUNFIX_HPP)
#define BOOST_TTI_DETAIL_MACRO_SUNFIX_HPP
#if defined(__SUNPRO_CC)
#define BOOST_TTI_DETAIL_MACRO_SUNFIX {}
#else
#define BOOST_TTI_DETAIL_MACRO_SUNFIX
#endif
#endif // BOOST_TTI_DETAIL_MACRO_SUNFIX_HPP

View File

@@ -7,7 +7,6 @@
#if !defined(BOOST_TTI_DETAIL_MEM_DATA_HPP)
#define BOOST_TTI_DETAIL_MEM_DATA_HPP
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/function_types/components.hpp>
#include <boost/function_types/is_member_object_pointer.hpp>
@@ -15,13 +14,12 @@
#include <boost/mpl/bool.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/or.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/detail/ddeftype.hpp>
#include <boost/tti/detail/dftclass.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
@@ -87,7 +85,7 @@
BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_C> \
struct BOOST_PP_CAT(trait,_detail_hmd_op) : \
BOOST_PP_CAT(trait,_detail_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_C> \
BOOST_PP_CAT(trait,_detail_hmf_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_C> \
{ \
}; \
/**/
@@ -97,46 +95,46 @@
#define BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_DATA_INVOKE_ENCLOSING_CLASS(trait) \
template<class BOOST_TTI_DETAIL_TP_ET,class BOOST_TTI_DETAIL_TP_TYPE> \
struct BOOST_PP_CAT(trait,_detail_hmd_invoke_enclosing_class) : \
BOOST_PP_CAT(trait,_detail_hmd_op) \
< \
typename BOOST_TTI_NAMESPACE::detail::ptmd<BOOST_TTI_DETAIL_TP_ET,BOOST_TTI_DETAIL_TP_TYPE>::type, \
typename boost::remove_const<BOOST_TTI_DETAIL_TP_ET>::type \
> \
{ \
}; \
BOOST_PP_CAT(trait,_detail_hmd_op) \
< \
typename BOOST_TTI_NAMESPACE::detail::ptmd<BOOST_TTI_DETAIL_TP_ET,BOOST_TTI_DETAIL_TP_TYPE>::type, \
typename boost::remove_const<BOOST_TTI_DETAIL_TP_ET>::type \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_DATA_INVOKE_PT_MEMBER(trait) \
template<class BOOST_TTI_DETAIL_TP_ET,class BOOST_TTI_DETAIL_TP_TYPE> \
struct BOOST_PP_CAT(trait,_detail_hmd_invoke_pt_member) : \
BOOST_PP_CAT(trait,_detail_hmd_op) \
< \
typename BOOST_TTI_NAMESPACE::detail::dmem_get_type<BOOST_TTI_DETAIL_TP_ET,BOOST_TTI_DETAIL_TP_TYPE>::type, \
typename boost::remove_const \
< \
typename BOOST_TTI_NAMESPACE::detail::dmem_get_enclosing<BOOST_TTI_DETAIL_TP_ET,BOOST_TTI_DETAIL_TP_TYPE>::type \
>::type \
> \
{ \
}; \
BOOST_PP_CAT(trait,_detail_hmd_op) \
< \
typename BOOST_TTI_NAMESPACE::detail::dmem_get_type<BOOST_TTI_DETAIL_TP_ET,BOOST_TTI_DETAIL_TP_TYPE>::type, \
typename boost::remove_const \
< \
typename BOOST_TTI_NAMESPACE::detail::dmem_get_enclosing<BOOST_TTI_DETAIL_TP_ET,BOOST_TTI_DETAIL_TP_TYPE>::type \
>::type \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_DATA_WITH_ENCLOSING_CLASS(trait) \
BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_DATA_INVOKE_ENCLOSING_CLASS(trait) \
template<class BOOST_TTI_DETAIL_TP_ET,class BOOST_TTI_DETAIL_TP_TYPE> \
struct BOOST_PP_CAT(trait,_detail_hmd_with_enclosing_class) : \
boost::mpl::eval_if \
< \
boost::is_class<BOOST_TTI_DETAIL_TP_ET>, \
BOOST_PP_CAT(trait,_detail_hmd_invoke_enclosing_class) \
< \
BOOST_TTI_DETAIL_TP_ET, \
BOOST_TTI_DETAIL_TP_TYPE \
>, \
boost::mpl::false_ \
> \
{ \
}; \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_ET>, \
BOOST_PP_CAT(trait,_detail_hmd_invoke_enclosing_class) \
< \
BOOST_TTI_DETAIL_TP_ET, \
BOOST_TTI_DETAIL_TP_TYPE \
>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_DATA(trait,name) \
@@ -145,20 +143,20 @@
BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_DATA_INVOKE_PT_MEMBER(trait) \
template<class BOOST_TTI_DETAIL_TP_ET,class BOOST_TTI_DETAIL_TP_TYPE> \
struct BOOST_PP_CAT(trait,_detail_hmd) : \
boost::mpl::eval_if \
< \
boost::is_same<BOOST_TTI_DETAIL_TP_TYPE,BOOST_TTI_NAMESPACE::detail::deftype>, \
BOOST_PP_CAT(trait,_detail_hmd_invoke_pt_member) \
< \
BOOST_TTI_DETAIL_TP_ET, \
BOOST_TTI_DETAIL_TP_TYPE \
>, \
BOOST_PP_CAT(trait,_detail_hmd_with_enclosing_class) \
< \
BOOST_TTI_DETAIL_TP_ET, \
BOOST_TTI_DETAIL_TP_TYPE \
> \
> \
boost::mpl::eval_if \
< \
boost::is_same<BOOST_TTI_DETAIL_TP_TYPE,BOOST_TTI_NAMESPACE::detail::deftype>, \
BOOST_PP_CAT(trait,_detail_hmd_invoke_pt_member) \
< \
BOOST_TTI_DETAIL_TP_ET, \
BOOST_TTI_DETAIL_TP_TYPE \
>, \
BOOST_PP_CAT(trait,_detail_hmd_with_enclosing_class) \
< \
BOOST_TTI_DETAIL_TP_ET, \
BOOST_TTI_DETAIL_TP_TYPE \
> \
> \
{ \
}; \
/**/

View File

@@ -7,7 +7,6 @@
#if !defined(BOOST_TTI_DETAIL_MEM_FUN_HPP)
#define BOOST_TTI_DETAIL_MEM_FUN_HPP
#include <boost/config.hpp>
#include <boost/function_types/is_member_function_pointer.hpp>
#include <boost/function_types/property_tags.hpp>
#include <boost/mpl/and.hpp>
@@ -18,23 +17,22 @@
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/tti/detail/dcomp_mem_fun.hpp>
#include <boost/tti/detail/ddeftype.hpp>
#include <boost/tti/detail/dmacro_sunfix.hpp>
#include <boost/tti/detail/dnullptr.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/detail/dptmf.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#if defined(__SUNPRO_CC)
#define BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \
template<class BOOST_TTI_DETAIL_TP_PMEMF,class BOOST_TTI_DETAIL_TP_C> \
struct BOOST_PP_CAT(trait,_detail_types) \
struct BOOST_PP_CAT(trait,_detail_hmf_types) \
{ \
template<BOOST_TTI_DETAIL_TP_PMEMF> \
struct helper {}; \
struct helper BOOST_TTI_DETAIL_MACRO_SUNFIX ; \
\
template<class BOOST_TTI_DETAIL_TP_EC> \
static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_EC::name> *); \
@@ -46,32 +44,11 @@
}; \
/**/
#else
#define BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \
template<class BOOST_TTI_DETAIL_TP_PMEMF,class BOOST_TTI_DETAIL_TP_C> \
struct BOOST_PP_CAT(trait,_detail_types) \
{ \
template<BOOST_TTI_DETAIL_TP_PMEMF> \
struct helper; \
\
template<class BOOST_TTI_DETAIL_TP_EC> \
static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_EC::name> *); \
\
template<class BOOST_TTI_DETAIL_TP_EC> \
static ::boost::type_traits::no_type chkt(...); \
\
typedef boost::mpl::bool_<sizeof(chkt<BOOST_TTI_DETAIL_TP_C>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)> type; \
}; \
/**/
#endif
#define BOOST_TTI_DETAIL_TRAIT_CTMF_INVOKE(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_ctmf_invoke) : \
BOOST_PP_CAT(trait,_detail_types) \
struct BOOST_PP_CAT(trait,_detail_hmf_ctmf_invoke) : \
BOOST_PP_CAT(trait,_detail_hmf_types) \
< \
typename BOOST_TTI_NAMESPACE::detail::ptmf_seq<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>::type, \
BOOST_TTI_DETAIL_TP_T \
@@ -83,19 +60,19 @@
#define BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \
BOOST_TTI_DETAIL_TRAIT_CTMF_INVOKE(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_call_types) : \
boost::mpl::eval_if \
< \
boost::is_class<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_ctmf_invoke) \
< \
BOOST_TTI_DETAIL_TP_T, \
BOOST_TTI_DETAIL_TP_R, \
BOOST_TTI_DETAIL_TP_FS, \
BOOST_TTI_DETAIL_TP_TAG \
>, \
boost::mpl::false_ \
> \
struct BOOST_PP_CAT(trait,_detail_hmf_call_types) : \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_hmf_ctmf_invoke) \
< \
BOOST_TTI_DETAIL_TP_T, \
BOOST_TTI_DETAIL_TP_R, \
BOOST_TTI_DETAIL_TP_FS, \
BOOST_TTI_DETAIL_TP_TAG \
>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
@@ -103,7 +80,7 @@
#define BOOST_TTI_DETAIL_TRAIT_CHECK_HAS_COMP_MEMBER_FUNCTION(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_COMP_MEMBER_FUNCTION(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T> \
struct BOOST_PP_CAT(trait,_detail_check_comp) : \
struct BOOST_PP_CAT(trait,_detail_hmf_check_comp) : \
BOOST_PP_CAT(trait,_detail_hcmf)<BOOST_TTI_DETAIL_TP_T> \
{ \
BOOST_MPL_ASSERT((boost::function_types::is_member_function_pointer<BOOST_TTI_DETAIL_TP_T>)); \
@@ -123,8 +100,8 @@
boost::is_same<BOOST_TTI_DETAIL_TP_FS,boost::mpl::vector<> >, \
boost::is_same<BOOST_TTI_DETAIL_TP_TAG,boost::function_types::null_tag> \
>, \
BOOST_PP_CAT(trait,_detail_check_comp)<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_call_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \
BOOST_PP_CAT(trait,_detail_hmf_check_comp)<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_hmf_call_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \
> \
{ \
}; \

View File

@@ -0,0 +1,110 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_MEM_FUN_TEMPLATE_HPP)
#define BOOST_TTI_DETAIL_MEM_FUN_TEMPLATE_HPP
#include <boost/function_types/is_member_function_pointer.hpp>
#include <boost/function_types/property_tags.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/logical.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/array/enum.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/tti/detail/dcomp_mem_fun_template.hpp>
#include <boost/tti/detail/ddeftype.hpp>
#include <boost/tti/detail/dnullptr.hpp>
#include <boost/tti/detail/dptmf.hpp>
#include <boost/tti/detail/dmacro_sunfix.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#define BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_PMEMF,class BOOST_TTI_DETAIL_TP_C> \
struct BOOST_PP_CAT(trait,_detail_hmft_types) \
{ \
template<BOOST_TTI_DETAIL_TP_PMEMF> \
struct helper BOOST_TTI_DETAIL_MACRO_SUNFIX ; \
\
template<class BOOST_TTI_DETAIL_TP_EC> \
static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_EC::template name<BOOST_PP_ARRAY_ENUM(pparray)> > *); \
\
template<class BOOST_TTI_DETAIL_TP_EC> \
static ::boost::type_traits::no_type chkt(...); \
\
typedef boost::mpl::bool_<sizeof(chkt<BOOST_TTI_DETAIL_TP_C>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)> type; \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_CTMF_INVOKE_TEMPLATE(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_HAS_TYPES_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hmft_ctmf_invoke_template) : \
BOOST_PP_CAT(trait,_detail_hmft_types) \
< \
typename BOOST_TTI_NAMESPACE::detail::ptmf_seq<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>::type, \
BOOST_TTI_DETAIL_TP_T \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_CTMF_INVOKE_TEMPLATE(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hmft_call_types) : \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_hmft_ctmf_invoke_template) \
< \
BOOST_TTI_DETAIL_TP_T, \
BOOST_TTI_DETAIL_TP_R, \
BOOST_TTI_DETAIL_TP_FS, \
BOOST_TTI_DETAIL_TP_TAG \
>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_CHECK_HAS_COMP_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_HAS_COMP_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_T> \
struct BOOST_PP_CAT(trait,_detail_hmft_check_comp) : \
BOOST_PP_CAT(trait,_detail_hcmft)<BOOST_TTI_DETAIL_TP_T> \
{ \
BOOST_MPL_ASSERT((boost::function_types::is_member_function_pointer<BOOST_TTI_DETAIL_TP_T>)); \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_CHECK_HAS_COMP_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hmft) : \
boost::mpl::eval_if \
< \
boost::mpl::and_ \
< \
boost::is_same<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_NAMESPACE::detail::deftype>, \
boost::is_same<BOOST_TTI_DETAIL_TP_FS,boost::mpl::vector<> >, \
boost::is_same<BOOST_TTI_DETAIL_TP_TAG,boost::function_types::null_tag> \
>, \
BOOST_PP_CAT(trait,_detail_hmft_check_comp)<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_hmft_call_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \
> \
{ \
}; \
/**/
#endif // BOOST_TTI_DETAIL_MEM_FUN_TEMPLATE_HPP

View File

@@ -12,13 +12,14 @@
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#define BOOST_TTI_DETAIL_TRAIT_HAS_TYPE_MEMBER_TYPE_OP(trait,name) \
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(BOOST_PP_CAT(trait,_detail_mpl), name, false) \
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(BOOST_PP_CAT(trait,_detail_member_type_mpl), name, false) \
template<class BOOST_TTI_DETAIL_TP_T> \
struct BOOST_PP_CAT(trait,_detail_op) : \
BOOST_PP_CAT(trait,_detail_mpl)<BOOST_TTI_DETAIL_TP_T> \
struct BOOST_PP_CAT(trait,_detail_member_type_op) : \
BOOST_PP_CAT(trait,_detail_member_type_mpl)<BOOST_TTI_DETAIL_TP_T> \
{ \
}; \
/**/
@@ -26,15 +27,15 @@
#define BOOST_TTI_DETAIL_TRAIT_HAS_TYPE_MEMBER_TYPE(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_TYPE_MEMBER_TYPE_OP(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T> \
struct BOOST_PP_CAT(trait,_detail) \
struct BOOST_PP_CAT(trait,_detail_has_type_member_type) \
{ \
typedef typename \
boost::mpl::eval_if \
< \
boost::is_class<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_op)<BOOST_TTI_DETAIL_TP_T>, \
boost::mpl::false_ \
>::type type; \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_member_type_op)<BOOST_TTI_DETAIL_TP_T>, \
boost::mpl::false_ \
>::type type; \
\
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \

View File

@@ -7,7 +7,6 @@
#if !defined(BOOST_TTI_DETAIL_PTMF_HPP)
#define BOOST_TTI_DETAIL_PTMF_HPP
#include <boost/config.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/function_types/member_function_pointer.hpp>

View File

@@ -0,0 +1,39 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_STATIC_FUNCTION_TAGS_HPP)
#define BOOST_TTI_DETAIL_STATIC_FUNCTION_TAGS_HPP
#include <boost/function_types/property_tags.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/or.hpp>
namespace boost
{
namespace tti
{
namespace detail
{
template
<
class BOOST_TTI_DETAIL_TP_TAG
>
struct static_function_tag :
boost::mpl::not_
<
boost::mpl::or_
<
boost::function_types::has_const_property_tag<BOOST_TTI_DETAIL_TP_TAG>,
boost::function_types::has_volatile_property_tag<BOOST_TTI_DETAIL_TP_TAG>
>
>
{
};
}
}
}
#endif // BOOST_TTI_DETAIL_STATIC_FUNCTION_TAGS_HPP

View File

@@ -0,0 +1,41 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_STATIC_FUNCTION_TYPE_HPP)
#define BOOST_TTI_DETAIL_STATIC_FUNCTION_TYPE_HPP
#include <boost/function_types/is_function.hpp>
#include <boost/function_types/property_tags.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost
{
namespace tti
{
namespace detail
{
template
<
class BOOST_TTI_DETAIL_TP_R,
class BOOST_TTI_DETAIL_TP_FS,
class BOOST_TTI_DETAIL_TP_TAG
>
struct static_function_type :
boost::mpl::and_
<
boost::is_same<BOOST_TTI_DETAIL_TP_TAG,boost::function_types::null_tag>,
boost::is_same<BOOST_TTI_DETAIL_TP_FS,boost::mpl::vector<> >,
boost::function_types::is_function<BOOST_TTI_DETAIL_TP_R>
>
{
};
}
}
}
#endif // BOOST_TTI_DETAIL_STATIC_FUNCTION_TYPE_HPP

View File

@@ -14,7 +14,10 @@
#include <boost/preprocessor/cat.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/detail/dmacro_sunfix.hpp>
#include <boost/tti/detail/dnullptr.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#if defined(BOOST_MSVC)
@@ -60,25 +63,6 @@
}; \
/**/
#elif defined(__SUNPRO_CC)
#define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA_OP(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_TYPE> \
struct BOOST_PP_CAT(trait,_detail_hsd_op) \
{ \
template<BOOST_TTI_DETAIL_TP_TYPE *> \
struct helper {}; \
\
template<class BOOST_TTI_DETAIL_TP_U> \
static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_U::name> *); \
\
template<class BOOST_TTI_DETAIL_TP_U> \
static ::boost::type_traits::no_type chkt(...); \
\
typedef boost::mpl::bool_<(!boost::function_types::is_function<BOOST_TTI_DETAIL_TP_TYPE>::value) && (sizeof(chkt<BOOST_TTI_DETAIL_TP_T>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type))> type; \
}; \
/**/
#else
#define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA_OP(trait,name) \
@@ -86,7 +70,7 @@
struct BOOST_PP_CAT(trait,_detail_hsd_op) \
{ \
template<BOOST_TTI_DETAIL_TP_TYPE *> \
struct helper; \
struct helper BOOST_TTI_DETAIL_MACRO_SUNFIX ; \
\
template<class BOOST_TTI_DETAIL_TP_U> \
static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_U::name> *); \
@@ -100,18 +84,38 @@
#endif // defined(BOOST_MSVC)
#if defined(BOOST_NO_CXX11_UNRESTRICTED_UNION)
#define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA_OP(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_TYPE> \
struct BOOST_PP_CAT(trait,_detail_hsd) : \
boost::mpl::eval_if \
< \
boost::is_class<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_hsd_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_TYPE>, \
boost::mpl::false_ \
> \
boost::mpl::eval_if \
< \
boost::is_class<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_hsd_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_TYPE>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
#else
#define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA_OP(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_TYPE> \
struct BOOST_PP_CAT(trait,_detail_hsd) : \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_hsd_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_TYPE>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
#endif
#endif // BOOST_TTI_DETAIL_STATIC_MEM_DATA_HPP

View File

@@ -7,29 +7,25 @@
#if !defined(BOOST_TTI_DETAIL_STATIC_MEM_FUN_HPP)
#define BOOST_TTI_DETAIL_STATIC_MEM_FUN_HPP
#include <boost/function_types/is_function.hpp>
#include <boost/function_types/property_tags.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/detail/dnullptr.hpp>
#include <boost/tti/detail/dmacro_sunfix.hpp>
#include <boost/tti/detail/dtfunction.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/detail/dstatic_function_tags.hpp>
#include <boost/tti/detail/dstatic_function_type.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#if defined(__SUNPRO_CC)
#define BOOST_TTI_DETAIL_TRAIT_IMPL_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_TYPE> \
struct BOOST_PP_CAT(trait,_detail_ihsmf) \
{ \
template<BOOST_TTI_DETAIL_TP_TYPE *> \
struct helper {}; \
struct helper BOOST_TTI_DETAIL_MACRO_SUNFIX ; \
\
template<class BOOST_TTI_DETAIL_TP_U> \
static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_U::name> *); \
@@ -41,46 +37,42 @@
}; \
/**/
#else
#define BOOST_TTI_DETAIL_TRAIT_IMPL_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_TYPE> \
struct BOOST_PP_CAT(trait,_detail_ihsmf) \
{ \
template<BOOST_TTI_DETAIL_TP_TYPE *> \
struct helper; \
\
template<class BOOST_TTI_DETAIL_TP_U> \
static ::boost::type_traits::yes_type chkt(helper<&BOOST_TTI_DETAIL_TP_U::name> *); \
\
template<class BOOST_TTI_DETAIL_TP_U> \
static ::boost::type_traits::no_type chkt(...); \
\
typedef boost::mpl::bool_<sizeof(chkt<BOOST_TTI_DETAIL_TP_T>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)> type; \
}; \
/**/
#endif
#define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_OP(trait,name) \
BOOST_TTI_DETAIL_TRAIT_IMPL_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
#define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEST_FUNC_CALL(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hsmf_op) : \
struct BOOST_PP_CAT(trait,_detail_hsmf_ttc) : \
BOOST_PP_CAT(trait,_detail_ihsmf) \
< \
BOOST_TTI_DETAIL_TP_T, \
typename \
boost::mpl::eval_if \
< \
boost::mpl::and_ \
< \
boost::function_types::is_function<BOOST_TTI_DETAIL_TP_R>, \
boost::is_same<BOOST_TTI_DETAIL_TP_FS,boost::mpl::vector<> >, \
boost::is_same<BOOST_TTI_DETAIL_TP_TAG,boost::function_types::null_tag> \
>, \
boost::mpl::identity<BOOST_TTI_DETAIL_TP_R>, \
BOOST_TTI_NAMESPACE::detail::tfunction_seq<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \
>::type \
typename BOOST_TTI_NAMESPACE::detail::tfunction_seq<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>::type \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEST_FUNC(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEST_FUNC_CALL(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hsmf_tt) : \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::static_function_tag<BOOST_TTI_DETAIL_TP_TAG>, \
BOOST_PP_CAT(trait,_detail_hsmf_ttc)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_OP(trait,name) \
BOOST_TTI_DETAIL_TRAIT_IMPL_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEST_FUNC(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hsmf_op) : \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::static_function_type<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
BOOST_PP_CAT(trait,_detail_ihsmf)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R>, \
BOOST_PP_CAT(trait,_detail_hsmf_tt)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \
> \
{ \
}; \
@@ -90,12 +82,12 @@
BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_OP(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hsmf) : \
boost::mpl::eval_if \
< \
boost::is_class<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_hsmf_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
boost::mpl::false_ \
> \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_hsmf_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/

View File

@@ -0,0 +1,96 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_STATIC_MEM_FUN_TEMPLATE_HPP)
#define BOOST_TTI_DETAIL_STATIC_MEM_FUN_TEMPLATE_HPP
#include <boost/mpl/bool.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/array/enum.hpp>
#include <boost/tti/detail/dmacro_sunfix.hpp>
#include <boost/tti/detail/dnullptr.hpp>
#include <boost/tti/detail/dtfunction.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/detail/dstatic_function_tags.hpp>
#include <boost/tti/detail/dstatic_function_type.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
#define BOOST_TTI_DETAIL_TRAIT_IMPL_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_TYPE> \
struct BOOST_PP_CAT(trait,_detail_ihsmft) \
{ \
template<BOOST_TTI_DETAIL_TP_TYPE *> \
struct helper BOOST_TTI_DETAIL_MACRO_SUNFIX ; \
\
template<class U> \
static ::boost::type_traits::yes_type check(helper<&U::template name<BOOST_PP_ARRAY_ENUM(pparray)> > *); \
\
template<class U> \
static ::boost::type_traits::no_type check(...); \
\
typedef boost::mpl::bool_<sizeof(check<BOOST_TTI_DETAIL_TP_T>(BOOST_TTI_DETAIL_NULLPTR))==sizeof(::boost::type_traits::yes_type)> type; \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE_TEST_FUNC_CALL(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hsmft_ttc) : \
BOOST_PP_CAT(trait,_detail_ihsmft) \
< \
BOOST_TTI_DETAIL_TP_T, \
typename BOOST_TTI_NAMESPACE::detail::tfunction_seq<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>::type \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE_TEST_FUNC(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE_TEST_FUNC_CALL(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hsmft_tt) : \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::static_function_tag<BOOST_TTI_DETAIL_TP_TAG>, \
BOOST_PP_CAT(trait,_detail_hsmft_ttc)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE_OP(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_IMPL_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE_TEST_FUNC(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hsmft_op) : \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::static_function_type<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
BOOST_PP_CAT(trait,_detail_ihsmft)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R>, \
BOOST_PP_CAT(trait,_detail_hsmft_tt)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE_OP(trait,name,pparray) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
struct BOOST_PP_CAT(trait,_detail_hsmft) : \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_hsmft_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
#endif // BOOST_TTI_DETAIL_STATIC_MEM_FUN_TEMPLATE_HPP

View File

@@ -14,7 +14,10 @@
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/debug/assert.hpp>
#include <boost/preprocessor/facilities/is_empty.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_union.hpp>
#define BOOST_TTI_DETAIL_IS_HELPER_BOOST_PP_NIL
@@ -54,12 +57,12 @@
struct trait \
{ \
typedef typename \
boost::mpl::eval_if \
< \
boost::is_class<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_tht)<BOOST_TTI_DETAIL_TP_T>, \
boost::mpl::false_ \
>::type type; \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_tht)<BOOST_TTI_DETAIL_TP_T>, \
boost::mpl::false_ \
>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/

View File

@@ -20,7 +20,8 @@
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/array/enum.hpp>
#include <boost/preprocessor/array/size.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#if !defined(BOOST_MPL_CFG_NO_HAS_XXX_TEMPLATE)
@@ -204,12 +205,12 @@ BOOST_PP_ARRAY_ELEM(BOOST_PP_ADD(4,n),args) \
struct trait \
{ \
typedef typename \
boost::mpl::eval_if \
< \
boost::is_class<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_cp_op)<BOOST_TTI_DETAIL_TP_T>, \
boost::mpl::false_ \
>::type type; \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_cp_op)<BOOST_TTI_DETAIL_TP_T>, \
boost::mpl::false_ \
>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/

View File

@@ -7,7 +7,6 @@
#if !defined(BOOST_TTI_DETAIL_TFUNCTION_HPP)
#define BOOST_TTI_DETAIL_TFUNCTION_HPP
#include <boost/config.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/function_types/function_type.hpp>

View File

@@ -7,7 +7,6 @@
#if !defined(BOOST_TTI_DETAIL_TYPE_HPP)
#define BOOST_TTI_DETAIL_TYPE_HPP
#include <boost/config.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/eval_if.hpp>
@@ -15,8 +14,8 @@
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/detail/ddeftype.hpp>
#include <boost/tti/detail/dlambda.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/type_traits/is_class.hpp>
#define BOOST_TTI_DETAIL_TRAIT_INVOKE_HAS_TYPE(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_MFC> \
@@ -67,12 +66,12 @@ struct BOOST_PP_CAT(trait,_detail_type_op) : \
BOOST_TTI_DETAIL_TRAIT_HAS_TYPE_OP(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U> \
struct BOOST_PP_CAT(trait,_detail_type) : \
boost::mpl::eval_if \
< \
boost::is_class<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_type_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_U>, \
boost::mpl::false_ \
> \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_type_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_U>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/

View File

@@ -0,0 +1,85 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_DETAIL_UNION_HPP)
#define BOOST_TTI_DETAIL_UNION_HPP
#include <boost/mpl/and.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/detail/ddeftype.hpp>
#include <boost/tti/detail/dlambda.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/type_traits/is_union.hpp>
#define BOOST_TTI_DETAIL_TRAIT_INVOKE_HAS_UNION(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_MFC> \
struct BOOST_PP_CAT(trait,_detail_union_invoke) \
{ \
BOOST_MPL_ASSERT((BOOST_TTI_NAMESPACE::detail::is_lambda_expression<BOOST_TTI_DETAIL_TP_MFC>)); \
typedef typename boost::mpl::apply<BOOST_TTI_DETAIL_TP_MFC,typename BOOST_TTI_DETAIL_TP_T::name>::type type; \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_UNION_OP_CHOOSE(trait,name) \
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(BOOST_PP_CAT(trait,_detail_union_mpl), name, false) \
BOOST_TTI_DETAIL_TRAIT_INVOKE_HAS_UNION(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U,class BOOST_TTI_DETAIL_TP_B> \
struct BOOST_PP_CAT(trait,_detail_union_op_choose) : \
boost::mpl::and_ \
< \
boost::is_union<typename BOOST_TTI_DETAIL_TP_T::name>, \
BOOST_PP_CAT(trait,_detail_union_invoke)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_U> \
> \
{ \
}; \
\
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U> \
struct BOOST_PP_CAT(trait,_detail_union_op_choose)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_U,boost::mpl::false_::type> : \
boost::mpl::false_ \
{ \
}; \
\
template<class BOOST_TTI_DETAIL_TP_T> \
struct BOOST_PP_CAT(trait,_detail_union_op_choose)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_NAMESPACE::detail::deftype,boost::mpl::true_::type> : \
boost::is_union<typename BOOST_TTI_DETAIL_TP_T::name> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_UNION_OP(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_UNION_OP_CHOOSE(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U> \
struct BOOST_PP_CAT(trait,_detail_union_op) : \
BOOST_PP_CAT(trait,_detail_union_op_choose) \
< \
BOOST_TTI_DETAIL_TP_T, \
BOOST_TTI_DETAIL_TP_U, \
typename BOOST_PP_CAT(trait,_detail_union_mpl)<BOOST_TTI_DETAIL_TP_T>::type \
> \
{ \
}; \
/**/
#define BOOST_TTI_DETAIL_TRAIT_HAS_UNION(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_UNION_OP(trait,name) \
template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_U> \
struct BOOST_PP_CAT(trait,_detail_union) : \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_union_op)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_U>, \
boost::mpl::false_ \
> \
{ \
}; \
/**/
#endif // BOOST_TTI_DETAIL_UNION_HPP

View File

@@ -28,7 +28,8 @@
#include <boost/preprocessor/variadic/to_seq.hpp>
#include <boost/tti/detail/dtemplate.hpp>
#include <boost/tti/detail/dtemplate_params.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/tti/detail/denclosing_type.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#if !defined(BOOST_MPL_CFG_NO_HAS_XXX_TEMPLATE)
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1400)
@@ -138,7 +139,7 @@
BOOST_TTI_DETAIL_VM_TRAIT_HAS_TEMPLATE_CHECK_PARAMS(BOOST_PP_CAT(trait,_detail),name,__VA_ARGS__) \
template<class BOOST_TTI_DETAIL_TP_T> \
struct BOOST_PP_CAT(trait,_detail_vm_ct_invoke) : \
BOOST_PP_CAT(trait,_detail)<BOOST_TTI_DETAIL_TP_T> \
BOOST_PP_CAT(trait,_detail)<BOOST_TTI_DETAIL_TP_T> \
{ \
}; \
/**/
@@ -149,12 +150,12 @@
struct trait \
{ \
typedef typename \
boost::mpl::eval_if \
< \
boost::is_class<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_vm_ct_invoke)<BOOST_TTI_DETAIL_TP_T>, \
boost::mpl::false_ \
>::type type; \
boost::mpl::eval_if \
< \
BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
BOOST_PP_CAT(trait,_detail_vm_ct_invoke)<BOOST_TTI_DETAIL_TP_T>, \
boost::mpl::false_ \
>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/

View File

@@ -0,0 +1,31 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_CLASS_GEN_HPP)
#define BOOST_TTI_CLASS_GEN_HPP
#include <boost/preprocessor/cat.hpp>
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// Generates the macro metafunction name for BOOST_TTI_HAS_CLASS.
/**
name = the name of the class/struct.
returns = the generated macro metafunction name.
*/
#define BOOST_TTI_HAS_CLASS_GEN(name) \
BOOST_PP_CAT(has_class_,name) \
/**/
#endif // BOOST_TTI_CLASS_GEN_HPP

View File

@@ -20,7 +20,7 @@
/// Generates the macro metafunction name for BOOST_TTI_HAS_DATA.
/**
name = the name of the member data.
name = the name of the data.
returns = the generated macro metafunction name.
*/

View File

@@ -0,0 +1,31 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_ENUM_GEN_HPP)
#define BOOST_TTI_ENUM_GEN_HPP
#include <boost/preprocessor/cat.hpp>
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// Generates the macro metafunction name for BOOST_TTI_HAS_ENUM.
/**
name = the name of the enumeration.
returns = the generated macro metafunction name.
*/
#define BOOST_TTI_HAS_ENUM_GEN(name) \
BOOST_PP_CAT(has_enum_,name) \
/**/
#endif // BOOST_TTI_ENUM_GEN_HPP

View File

@@ -20,7 +20,7 @@
/// Generates the macro metafunction name for BOOST_TTI_HAS_FUNCTION.
/**
name = the name of the static member function.
name = the name of the function.
returns = the generated macro metafunction name.
*/

View File

@@ -0,0 +1,31 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_FUNCTION_TEMPLATE_GEN_HPP)
#define BOOST_TTI_FUNCTION_TEMPLATE_GEN_HPP
#include <boost/preprocessor/cat.hpp>
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// Generates the macro metafunction name for BOOST_TTI_HAS_FUNCTION_TEMPLATE.
/**
name = the name of the function template.
returns = the generated macro metafunction name.
*/
#define BOOST_TTI_HAS_FUNCTION_TEMPLATE_GEN(name) \
BOOST_PP_CAT(has_function_template_,name) \
/**/
#endif // BOOST_TTI_FUNCTION_TEMPLATE_GEN_HPP

View File

@@ -0,0 +1,31 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_MEMBER_FUNCTION_TEMPLATE_GEN_HPP)
#define BOOST_TTI_MEMBER_FUNCTION_TEMPLATE_GEN_HPP
#include <boost/preprocessor/cat.hpp>
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// Generates the macro metafunction name for BOOST_TTI_HAS_MEMBER_FUNCTION_TEMPLATE.
/**
name = the name of the member function template.
returns = the generated macro metafunction name.
*/
#define BOOST_TTI_HAS_MEMBER_FUNCTION_TEMPLATE_GEN(name) \
BOOST_PP_CAT(has_member_function_template_,name) \
/**/
#endif // BOOST_TTI_MEMBER_FUNCTION_TEMPLATE_GEN_HPP

View File

@@ -0,0 +1,31 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_STATIC_MEMBER_FUNCTION_TEMPLATE_GEN_HPP)
#define BOOST_TTI_STATIC_MEMBER_FUNCTION_TEMPLATE_GEN_HPP
#include <boost/preprocessor/cat.hpp>
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// Generates the macro metafunction name for BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE.
/**
name = the name of the static member function template.
returns = the generated macro metafunction name.
*/
#define BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE_GEN(name) \
BOOST_PP_CAT(has_static_member_function_template_,name) \
/**/
#endif // BOOST_TTI_STATIC_MEMBER_FUNCTION_TEMPLATE_GEN_HPP

View File

@@ -0,0 +1,31 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_UNION_GEN_HPP)
#define BOOST_TTI_UNION_GEN_HPP
#include <boost/preprocessor/cat.hpp>
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// Generates the macro metafunction name for BOOST_TTI_HAS_UNION.
/**
name = the name of the union.
returns = the generated macro metafunction name.
*/
#define BOOST_TTI_HAS_UNION_GEN(name) \
BOOST_PP_CAT(has_union_,name) \
/**/
#endif // BOOST_TTI_UNION_GEN_HPP

View File

@@ -0,0 +1,184 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_HAS_CLASS_HPP)
#define BOOST_TTI_HAS_CLASS_HPP
#include <boost/config.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/gen/has_class_gen.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/tti/detail/dclass.hpp>
#include <boost/tti/detail/ddeftype.hpp>
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// A macro which expands to a metafunction which tests whether an inner class/struct with a particular name exists.
/**
BOOST_TTI_TRAIT_HAS_CLASS is a macro which expands to a metafunction.
The metafunction tests whether an inner class/struct with a particular name exists
and, optionally, whether an MPL lambda expression invoked with the inner class/struct
is true or not. The macro takes the form of BOOST_TTI_TRAIT_HAS_CLASS(trait,name) where
trait = the name of the metafunction <br/>
name = the name of the inner class/struct.
BOOST_TTI_TRAIT_HAS_CLASS generates a metafunction called "trait" where 'trait' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_U>
struct trait
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_U = (optional) An optional template parameter, defaulting to a marker type.
If specified it is an MPL lambda expression which is invoked
with the inner class/struct found and must return a constant boolean
value.
returns = 'value' depends on whether or not the optional BOOST_TTI_TP_U is specified.
If BOOST_TTI_TP_U is not specified, then 'value' is true if the 'name' class/struct
exists within the enclosing type BOOST_TTI_TP_T; otherwise 'value' is false.
If BOOST_TTI_TP_U is specified , then 'value' is true if the 'name' class/struct exists
within the enclosing type BOOST_TTI_TP_T and the MPL lambda expression as specified
by BOOST_TTI_TP_U, invoked by passing the actual inner class/struct of 'name', returns
a 'value' of true; otherwise 'value' is false.
The action taken with BOOST_TTI_TP_U occurs only when the 'name' class/struct exists
within the enclosing type BOOST_TTI_TP_T.
@endcode
Example usage:
@code
BOOST_TTI_TRAIT_HAS_CLASS(LookFor,MyType) generates the metafunction "LookFor" in the current scope
to look for an inner class/struct called MyType.
LookFor<EnclosingType>::value is true if MyType is an inner class/struct of EnclosingType, otherwise false.
LookFor<EnclosingType,ALambdaExpression>::value is true if MyType is an inner class/struct of EnclosingType
and invoking ALambdaExpression with the inner class/struct returns a value of true, otherwise false.
A popular use of the optional MPL lambda expression is to check whether the class/struct found is the same
as another type, when the class/struct found is a typedef. In that case our example would be:
LookFor<EnclosingType,boost::is_same<_,SomeOtherType> >::value is true if MyType is an inner class/struct
of EnclosingType and is the same type as SomeOtherType.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_CLASS(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_CLASS(trait,name) \
template \
< \
class BOOST_TTI_TP_T, \
class BOOST_TTI_TP_U = BOOST_TTI_NAMESPACE::detail::deftype \
> \
struct trait \
{ \
typedef typename \
BOOST_PP_CAT(trait,_detail_class)<BOOST_TTI_TP_T,BOOST_TTI_TP_U>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/
/// A macro which expands to a metafunction which tests whether an inner class/struct with a particular name exists.
/**
BOOST_TTI_HAS_CLASS is a macro which expands to a metafunction.
The metafunction tests whether an inner class/struct with a particular name exists
and, optionally, whether an MPL lambda expression invoked with the inner class/struct
is true or not. The macro takes the form of BOOST_TTI_HAS_CLASS(name) where
name = the name of the inner class/struct.
BOOST_TTI_HAS_CLASS generates a metafunction called "has_class_'name'" where 'name' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_U>
struct has_class_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_U = (optional) An optional template parameter, defaulting to a marker type.
If specified it is an MPL lambda expression which is invoked
with the inner class/struct found and must return a constant boolean
value.
returns = 'value' depends on whether or not the optional BOOST_TTI_TP_U is specified.
If BOOST_TTI_TP_U is not specified, then 'value' is true if the 'name' class/struct
exists within the enclosing type BOOST_TTI_TP_T; otherwise 'value' is false.
If BOOST_TTI_TP_U is specified, then 'value' is true if the 'name' class/struct exists
within the enclosing type BOOST_TTI_TP_T and the MPL lambda expression as specified
by BOOST_TTI_TP_U, invoked by passing the actual inner class/struct of 'name', returns
a 'value' of true; otherwise 'value' is false.
The action taken with BOOST_TTI_TP_U occurs only when the 'name' class/struct exists
within the enclosing type BOOST_TTI_TP_T.
@endcode
Example usage:
@code
BOOST_TTI_HAS_CLASS(MyType) generates the metafunction "has_class_MyType" in the current scope
to look for an inner class/struct called MyType.
has_class_MyType<EnclosingType>::value is true if MyType is an inner class/struct of EnclosingType, otherwise false.
has_class_MyType<EnclosingType,ALambdaExpression>::value is true if MyType is an inner class/struct of EnclosingType
and invoking ALambdaExpression with the inner class/struct returns a value of true, otherwise false.
A popular use of the optional MPL lambda expression is to check whether the class/struct found is the same
as another type, when the class/struct found is a typedef. In that case our example would be:
has_class_MyType<EnclosingType,boost::is_same<_,SomeOtherType> >::value is true if MyType is an inner class/struct
of EnclosingType and is the same type as SomeOtherType.
@endcode
*/
#define BOOST_TTI_HAS_CLASS(name) \
BOOST_TTI_TRAIT_HAS_CLASS \
( \
BOOST_TTI_HAS_CLASS_GEN(name), \
name \
) \
/**/
#endif // BOOST_TTI_HAS_CLASS_HPP

View File

@@ -22,15 +22,20 @@
/** \file
*/
/// Expands to a metafunction which tests whether member data or static member with a particular name and type exists.
/// A macro which expands to a metafunction which tests whether member data or static member data with a particular name and type exists.
/**
trait = the name of the metafunction.
BOOST_TTI_TRAIT_HAS_DATA is a macro which expands to a metafunction.
The metafunction tests whether member data or static member data with a particular
name and type exists. The macro takes the form of BOOST_TTI_TRAIT_HAS_DATA(trait,name) where
name = the name of the inner member to introspect.
trait = the name of the metafunction <br/>
name = the name of the inner data.
generates a metafunction called "trait" where 'trait' is the macro parameter.
BOOST_TTI_TRAIT_HAS_DATA generates a metafunction called "trait" where 'trait' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE>
struct trait
{
@@ -41,12 +46,19 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'
The enclosing type can be a class, struct, or union.
If the type is a union, static member data can only
be found if the C++11 unrestricted union is implemented
by the compiler being used, since prior to C++11 a union
could not have static data members.
BOOST_TTI_TP_TYPE = The type of the member data or static member.
returns = 'value' is true if the 'name' exists, with the correct data type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_DATA(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_DATA(trait,name) \
@@ -63,15 +75,21 @@
}; \
/**/
/// Expands to a metafunction which tests whether member data or static member data with a particular name and type exists.
/// A macro which expands to a metafunction which tests whether member data or static member data with a particular name and type exists.
/**
name = the name of the inner member.
generates a metafunction called "has_data_name" where 'name' is the macro parameter.
BOOST_TTI_HAS_DATA is a macro which expands to a metafunction.
The metafunction tests whether member data or static member data with a particular
name and type exists. The macro takes the form of BOOST_TTI_HAS_DATA(name) where
name = the name of the inner data.
BOOST_TTI_HAS_DATA generates a metafunction called "has_data_name" where 'name' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE>
struct has_data_name
struct has_data_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
@@ -80,12 +98,19 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'
The enclosing type can be a class, struct, or union.
If the type is a union, static member data can only
be found if the C++11 unrestricted union is implemented
by the compiler being used, since prior to C++11 a union
could not have static data members.
BOOST_TTI_TP_TYPE = The type of the member data or static member.
returns = 'value' is true if the 'name' exists, with the correct data type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_HAS_DATA(name) \
BOOST_TTI_TRAIT_HAS_DATA \

View File

@@ -0,0 +1,184 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_HAS_ENUM_HPP)
#define BOOST_TTI_HAS_ENUM_HPP
#include <boost/config.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/gen/has_enum_gen.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/tti/detail/denum.hpp>
#include <boost/tti/detail/ddeftype.hpp>
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// A macro which expands to a metafunction which tests whether an inner enum with a particular name exists.
/**
BOOST_TTI_TRAIT_HAS_ENUM is a macro which expands to a metafunction.
The metafunction tests whether an inner enum with a particular name exists
and, optionally, whether an MPL lambda expression invoked with the inner enum
is true or not. The macro takes the form of BOOST_TTI_TRAIT_HAS_ENUM(trait,name) where
trait = the name of the metafunction <br/>
name = the name of the inner enum. The name can be that of an enum or, in C++11 on up, an enum class.
BOOST_TTI_TRAIT_HAS_ENUM generates a metafunction called "trait" where 'trait' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_U>
struct trait
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_U = (optional) An optional template parameter, defaulting to a marker type.
If specified it is an MPL lambda expression which is invoked
with the inner enum found and must return a constant boolean
value.
returns = 'value' depends on whether or not the optional BOOST_TTI_TP_U is specified.
If BOOST_TTI_TP_U is not specified, then 'value' is true if the 'name' enum
exists within the enclosing type BOOST_TTI_TP_T; otherwise 'value' is false.
If BOOST_TTI_TP_U is specified , then 'value' is true if the 'name' enum exists
within the enclosing type BOOST_TTI_TP_T and the MPL lambda expression as specified
by BOOST_TTI_TP_U, invoked by passing the actual inner enum of 'name', returns
a 'value' of true; otherwise 'value' is false.
The action taken with BOOST_TTI_TP_U occurs only when the 'name' enum exists
within the enclosing type BOOST_TTI_TP_T.
@endcode
Example usage:
@code
BOOST_TTI_TRAIT_HAS_ENUM(LookFor,MyType) generates the metafunction LookFor in the current scope
to look for an inner enum called MyType.
LookFor<EnclosingType>::value is true if MyType is an inner enum of EnclosingType, otherwise false.
LookFor<EnclosingType,ALambdaExpression>::value is true if MyType is an inner enum of EnclosingType
and invoking ALambdaExpression with the inner enum returns a value of true, otherwise false.
A popular use of the optional MPL lambda expression is to check whether the enum found is the same
as another type, when the enum found is a typedef. In that case our example would be:
LookFor<EnclosingType,boost::is_same<_,SomeOtherType> >::value is true if MyType is an inner enum
of EnclosingType and is the same type as SomeOtherType.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_ENUM(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_ENUM(trait,name) \
template \
< \
class BOOST_TTI_TP_T, \
class BOOST_TTI_TP_U = BOOST_TTI_NAMESPACE::detail::deftype \
> \
struct trait \
{ \
typedef typename \
BOOST_PP_CAT(trait,_detail_enum)<BOOST_TTI_TP_T,BOOST_TTI_TP_U>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/
/// A macro which expands to a metafunction which tests whether an inner enum with a particular name exists.
/**
BOOST_TTI_HAS_ENUM is a macro which expands to a metafunction.
The metafunction tests whether an inner enum with a particular name exists
and, optionally, whether an MPL lambda expression invoked with the inner enum
is true or not. The macro takes the form of BOOST_TTI_HAS_ENUM(name) where
name = the name of the inner enum. The name can be that of an enum or, in C++11 on up, an enum class.
BOOST_TTI_HAS_ENUM generates a metafunction called "has_enum_'name'" where 'name' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_U>
struct has_enum_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_U = (optional) An optional template parameter, defaulting to a marker type.
If specified it is an MPL lambda expression which is invoked
with the inner enum found and must return a constant boolean
value.
returns = 'value' depends on whether or not the optional BOOST_TTI_TP_U is specified.
If BOOST_TTI_TP_U is not specified, then 'value' is true if the 'name' enum
exists within the enclosing type BOOST_TTI_TP_T; otherwise 'value' is false.
If BOOST_TTI_TP_U is specified, then 'value' is true if the 'name' enum exists
within the enclosing type BOOST_TTI_TP_T and the MPL lambda expression as specified
by BOOST_TTI_TP_U, invoked by passing the actual inner enum of 'name', returns
a 'value' of true; otherwise 'value' is false.
The action taken with BOOST_TTI_TP_U occurs only when the 'name' enum exists
within the enclosing type BOOST_TTI_TP_T.
@endcode
Example usage:
@code
BOOST_TTI_HAS_ENUM(MyType) generates the metafunction has_enum_MyType in the current scope
to look for an inner enum called MyType.
has_enum_MyType<EnclosingType>::value is true if MyType is an inner enum of EnclosingType, otherwise false.
has_class_MyType<EnclosingType,ALambdaExpression>::value is true if MyType is an inner enum of EnclosingType
and invoking ALambdaExpression with the inner enum returns a value of true, otherwise false.
A popular use of the optional MPL lambda expression is to check whether the enum found is the same
as another type, when the enum found is a typedef. In that case our example would be:
has_enum_MyType<EnclosingType,boost::is_same<_,SomeOtherType> >::value is true if MyType is an inner enum
of EnclosingType and is the same type as SomeOtherType.
@endcode
*/
#define BOOST_TTI_HAS_ENUM(name) \
BOOST_TTI_TRAIT_HAS_ENUM \
( \
BOOST_TTI_HAS_ENUM_GEN(name), \
name \
) \
/**/
#endif // BOOST_TTI_HAS_ENUM_HPP

View File

@@ -23,15 +23,20 @@
/** \file
*/
/// Expands to a metafunction which tests whether a member function or a static member function with a particular name and signature exists.
/// A macro which expands to a metafunction which tests whether a member function or a static member function with a particular name and signature exists.
/**
trait = the name of the metafunction within the tti namespace.
BOOST_TTI_TRAIT_HAS_FUNCTION is a macro which expands to a metafunction.
The metafunction tests whether a member function or a static member function with a particular name
and signature exists. The macro takes the form of BOOST_TTI_TRAIT_HAS_FUNCTION(trait,name) where
trait = the name of the metafunction <br/>
name = the name of the inner member.
generates a metafunction called "trait" where 'trait' is the macro parameter.
BOOST_TTI_TRAIT_HAS_FUNCTION generates a metafunction called "trait" where 'trait' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG>
struct trait
{
@@ -42,6 +47,7 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_R = the return type of the function
@@ -55,6 +61,8 @@
with the appropriate static member function type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_FUNCTION(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION(trait,name) \
@@ -67,15 +75,21 @@
}; \
/**/
/// Expands to a metafunction which tests whether a member function or a static member function with a particular name and signature exists.
/// A macro which expands to a metafunction which tests whether a member function or a static member function with a particular name and signature exists.
/**
BOOST_TTI_HAS_FUNCTION is a macro which expands to a metafunction.
The metafunction tests whether a member function or a static member function with a particular name
and signature exists. The macro takes the form of BOOST_TTI_HAS_FUNCTION(name) where
name = the name of the inner member.
generates a metafunction called "has_function_name" where 'name' is the macro parameter.
BOOST_TTI_HAS_FUNCTION generates a metafunction called "has_function_name" where 'name' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG>
struct trait
struct has_function_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
@@ -84,6 +98,7 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_R = the return type of the function
@@ -97,6 +112,8 @@
with the appropriate function type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_HAS_FUNCTION(name) \
BOOST_TTI_TRAIT_HAS_FUNCTION \

View File

@@ -0,0 +1,290 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_FUNCTION_TEMPLATE_HPP)
#define BOOST_TTI_FUNCTION_TEMPLATE_HPP
#include <boost/config.hpp>
#include <boost/function_types/property_tags.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/tti/gen/has_function_template_gen.hpp>
#include <boost/tti/detail/dfunction_template.hpp>
#if BOOST_PP_VARIADICS
#include <boost/tti/detail/dmacro_fun_template.hpp>
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// A macro which expands to a metafunction which tests whether an inner member function template or static member function template with a particular name exists.
/**
BOOST_TTI_TRAIT_HAS_FUNCTION_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner member function template or static member function template with a particular name exists.
The macro takes the form of BOOST_TTI_TRAIT_HAS_FUNCTION_TEMPLATE(trait,name,...) where
trait = the name of the metafunction <br/>
name = inner member function template or static member function template name <br/>
... = variadic parameters.
The variadic parameter(s) are either:
A sequence of valid instantiations for the static member function template parameters
ie. 'int,long,double' etc.
or
A single variadic parameter which is a Boost PP array whose elements are
a sequence of valid instantiations for the static member function template parameters
ie. '(3,(int,long,double))' etc. This form is allowed in order to be compatible
with using the non-variadic form of this macro.
BOOST_TTI_TRAIT_HAS_FUNCTION_TEMPLATE generates a metafunction called "trait" where 'trait' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct trait
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_R = the return type of the function template
in a single instantiation of the function template
BOOST_TTI_TP_FS = (optional) the parameters of the function template as a boost::mpl forward sequence
if the function template parameters are not empty. These parameters are a single
instantiation of the function template.
BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the function template
if a tag is needed.
returns = 'value' is true if the 'name' exists,
with the appropriate member function template or static member function template type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_FUNCTION_TEMPLATE(trait,name,...) \
BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_TEMPLATE \
( \
trait, \
name, \
BOOST_TTI_DETAIL_FUN_TEMPLATE_VARIADIC_TO_ARRAY(__VA_ARGS__) \
) \
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS = boost::mpl::vector<>,class BOOST_TTI_TP_TAG = boost::function_types::null_tag> \
struct trait \
{ \
typedef typename \
BOOST_PP_CAT(trait,_detail_hft)<BOOST_TTI_TP_T,BOOST_TTI_TP_R,BOOST_TTI_TP_FS,BOOST_TTI_TP_TAG>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/
/// A macro which expands to a metafunction which tests whether an inner member function template or static member function template with a particular name exists.
/**
BOOST_TTI__HAS_FUNCTION_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner member function template or static member function template with a particular name exists.
The macro takes the form of BOOST_TTI_HAS_FUNCTION_TEMPLATE(name,...) where
name = inner member function template or static member function template name <br/>
... = variadic parameters.
The variadic parameter(s) are either:
A sequence of valid instantiations for the static member function template parameters
ie. 'int,long,double' etc.
or
A single variadic parameter which is a Boost PP array whose elements are
a sequence of valid instantiations for the static member function template parameters
ie. '(3,(int,long,double))' etc. This form is allowed in order to be compatible
with using the non-variadic form of this macro.
BOOST_TTI_HAS_FUNCTION_TEMPLATE generates a metafunction called "has_function_template_'name'" where 'name' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct has_function_template_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_R = the return type of the function template
in a single instantiation of the function template
BOOST_TTI_TP_FS = (optional) the parameters of the function template as a boost::mpl forward sequence
if the function template parameters are not empty. These parameters are a single
instantiation of the function template.
BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the function template
if a tag is needed.
returns = 'value' is true if the 'name' exists,
with the appropriate member function template or static member function template type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_HAS_FUNCTION_TEMPLATE(name,...) \
BOOST_TTI_TRAIT_HAS_FUNCTION_TEMPLATE \
( \
BOOST_TTI_HAS_FUNCTION_TEMPLATE_GEN(name), \
name, \
__VA_ARGS__ \
) \
/**/
#else // !BOOST_PP_VARIADICS
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// A macro which expands to a metafunction which tests whether an inner member function template or static member function template with a particular name exists.
/**
BOOST_TTI_TRAIT_HAS_FUNCTION_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner member function template or static member function template with a particular name exists.
The macro takes the form of BOOST_TTI_TRAIT_HAS_FUNCTION_TEMPLATE(trait,name,pparray) where
trait = the name of the metafunction <br/>
name = inner member function template or static member function template name <br/>
pparray = a Boost PP array whose elements are a sequence of valid instantiations for
the static member function template parameters ie. '(3,(int,long,double))' etc.
BOOST_TTI_TRAIT_HAS_FUNCTION_TEMPLATE generates a metafunction called "trait" where 'trait' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct trait
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_R = the return type of the function template
in a single instantiation of the function template
BOOST_TTI_TP_FS = (optional) the parameters of the function template as a boost::mpl forward sequence
if the function template parameters are not empty. These parameters are a single
instantiation of the function template.
BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the function template
if a tag is needed.
returns = 'value' is true if the 'name' exists,
with the appropriate member function template or static member function template type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_FUNCTION_TEMPLATE(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_TEMPLATE(trait,name,pparray) \
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS = boost::mpl::vector<>,class BOOST_TTI_TP_TAG = boost::function_types::null_tag> \
struct trait \
{ \
typedef typename \
BOOST_PP_CAT(trait,_detail_hft)<BOOST_TTI_TP_T,BOOST_TTI_TP_R,BOOST_TTI_TP_FS,BOOST_TTI_TP_TAG>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/
/// A macro which expands to a metafunction which tests whether an inner member function template or static member function template with a particular name exists.
/**
BOOST_TTI_HAS_FUNCTION_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner member function template or static member function template with a particular name exists.
The macro takes the form of BOOST_TTI_HAS_FUNCTION_TEMPLATE(name,pparray) where
name = inner member function template or static member function template name <br/>
pparray = a Boost PP array whose elements are a sequence of valid instantiations for
the static member function template parameters ie. '(3,(int,long,double))' etc.
BOOST_TTI_HAS_FUNCTION_TEMPLATE generates a metafunction called "has_function_template_'name'" where 'name' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct has_function_template_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_R = the return type of the function template
in a single instantiation of the function template
BOOST_TTI_TP_FS = (optional) the parameters of the function template as a boost::mpl forward sequence
if the function template parameters are not empty. These parameters are a single
instantiation of the function template.
BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the function template
if a tag is needed.
returns = 'value' is true if the 'name' exists,
with the appropriate member function template or static member function template type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_HAS_FUNCTION_TEMPLATE(name,pparray) \
BOOST_TTI_TRAIT_HAS_FUNCTION_TEMPLATE \
( \
BOOST_TTI_HAS_FUNCTION_TEMPLATE_GEN(name), \
name, \
pparray \
) \
/**/
#endif // BOOST_PP_VARIADICS
#endif // BOOST_TTI_FUNCTION_TEMPLATE_HPP

View File

@@ -22,15 +22,20 @@
/** \file
*/
/// Expands to a metafunction which tests whether a member data with a particular name and type exists.
/// A macro which expands to a metafunction which tests whether member data with a particular name and type exists.
/**
trait = the name of the metafunction.
BOOST_TTI_TRAIT_HAS_MEMBER_DATA is a macro which expands to a metafunction.
The metafunction tests whether member data with a particular
name and type exists. The macro takes the form of BOOST_TTI_TRAIT_HAS_MEMBER_DATA(trait,name) where
name = the name of the inner member to introspect.
trait = the name of the metafunction. <br/>
name = the name of the inner member data.
generates a metafunction called "trait" where 'trait' is the macro parameter.
BOOST_TTI_TRAIT_HAS_MEMBER_DATA generates a metafunction called "trait" where 'trait' is the macro parameter.
@code
template<class BOOST_TTI_TP_ET,class BOOST_TTI_TP_TYPE>
struct trait
{
@@ -41,6 +46,7 @@
The metafunction types and return:
BOOST_TTI_TP_ET = the enclosing type in which to look for our 'name'
The enclosing type can be a class, struct, or union.
OR
The type of the member data in the form of a pointer
to member data.
@@ -51,6 +57,8 @@
returns = 'value' is true if the 'name' exists, with the correct data type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_MEMBER_DATA(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_DATA(trait,name) \
@@ -59,23 +67,29 @@
{ \
typedef typename \
BOOST_PP_CAT(trait,_detail_hmd) \
< \
BOOST_TTI_TP_ET, \
BOOST_TTI_TP_TYPE \
>::type type; \
< \
BOOST_TTI_TP_ET, \
BOOST_TTI_TP_TYPE \
>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/
/// Expands to a metafunction which tests whether a member data with a particular name and type exists.
/// A macro which expands to a metafunction which tests whether a member data with a particular name and type exists.
/**
BOOST_TTI_HAS_MEMBER_DATA is a macro which expands to a metafunction.
The metafunction tests whether member data with a particular
name and type exists. The macro takes the form of BOOST_TTI_HAS_MEMBER_DATA(name) where
name = the name of the inner member.
generates a metafunction called "has_member_data_name" where 'name' is the macro parameter.
BOOST_TTI_HAS_MEMBER_DATA generates a metafunction called "has_member_data_name" where 'name' is the macro parameter.
@code
template<class BOOST_TTI_TP_ET,class BOOST_TTI_TP_TYPE>
struct has_member_data_name
struct has_member_data_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
@@ -83,7 +97,8 @@
The metafunction types and return:
BOOST_TTI_TP_ET = the enclosing type in which to look for our 'name'
BOOST_TTI_TP_ET = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
OR
The type of the member data in the form of a pointer
to member data.
@@ -94,6 +109,8 @@
returns = 'value' is true if the 'name' exists, with the correct data type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_HAS_MEMBER_DATA(name) \
BOOST_TTI_TRAIT_HAS_MEMBER_DATA \

View File

@@ -25,15 +25,20 @@
/** \file
*/
/// Expands to a metafunction which tests whether a member function with a particular name and signature exists.
/// A macro which expands to a metafunction which tests whether a member function with a particular name and signature exists.
/**
trait = the name of the metafunction within the tti namespace.
BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION is a macro which expands to a metafunction.
The metafunction tests whether a member function with a particular name
and signature exists. The macro takes the form of BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION(trait,name) where
trait = the name of the metafunction <br/>
name = the name of the inner member.
generates a metafunction called "trait" where 'trait' is the macro parameter.<br />
BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION generates a metafunction called "trait" where 'trait' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct trait
{
@@ -43,9 +48,10 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
OR
a pointer to member function as a single type.
a pointer to member function as a single type.
BOOST_TTI_TP_R = (optional) the return type of the member function
if the first parameter is the enclosing type.
@@ -61,6 +67,8 @@
with the appropriate member function type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION(trait,name) \
@@ -73,15 +81,21 @@
}; \
/**/
/// Expands to a metafunction which tests whether a member function with a particular name and signature exists.
/// A macro which expands to a metafunction which tests whether a member function with a particular name and signature exists.
/**
BOOST_TTI_HAS_MEMBER_FUNCTION is a macro which expands to a metafunction.
The metafunction tests whether a member function with a particular name
and signature exists. The macro takes the form of BOOST_TTI_HAS_MEMBER_FUNCTION(name) where
name = the name of the inner member.
generates a metafunction called "has_member_function_name" where 'name' is the macro parameter.
BOOST_TTI_HAS_MEMBER_FUNCTION generates a metafunction called "has_member_function_name" where 'name' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG>
struct has_member_function_name
struct has_member_function_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
@@ -89,9 +103,10 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
OR
a pointer to member function as a single type.
a pointer to member function as a single type.
BOOST_TTI_TP_R = (optional) the return type of the member function
if the first parameter is the enclosing type.
@@ -107,6 +122,8 @@
with the appropriate member function type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_HAS_MEMBER_FUNCTION(name) \
BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION \

View File

@@ -0,0 +1,311 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_MEMBER_FUNCTION_TEMPLATE_HPP)
#define BOOST_TTI_MEMBER_FUNCTION_TEMPLATE_HPP
#include <boost/config.hpp>
#include <boost/function_types/property_tags.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/detail/ddeftype.hpp>
#include <boost/tti/detail/dmem_fun_template.hpp>
#include <boost/tti/gen/has_member_function_template_gen.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#if BOOST_PP_VARIADICS
#include <boost/tti/detail/dmacro_fun_template.hpp>
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// A macro which expands to a metafunction which tests whether an inner member function template with a particular name exists.
/**
BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner member function template with a particular name exists.
The macro takes the form of BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE(trait,name,...) where
trait = the name of the metafunction <br/>
name = inner member function template name <br/>
... = variadic parameters.
The variadic parameter(s) are either:
A sequence of valid instantiations for the member function template parameters
ie. 'int,long,double' etc.
or
A single variadic parameter which is a Boost PP array whose elements are
a sequence of valid instantiations for the member function template parameters
ie. '(3,(int,long,double))' etc. This form is allowed in order to be compatible
with using the non-variadic form of this macro.
BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE generates a metafunction called "trait" where 'trait' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct trait
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
OR
a pointer to member function as a single type
which encapsulates a single instantiation of
the member function template.
BOOST_TTI_TP_R = (optional) the return type of the member function template
in a single instantiation of the member function template
if the first parameter is the enclosing type.
BOOST_TTI_TP_FS = (optional) the parameters of the member function template as a boost::mpl forward sequence
if the first parameter is the enclosing type and the member function template parameters
are not empty. These parameters are a single instantiation of the member function template.
BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the member function template
if the first parameter is the enclosing type and a tag is needed.
returns = 'value' is true if the 'name' exists,
with the appropriate member function template type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE(trait,name,...) \
BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE \
( \
trait, \
name, \
BOOST_TTI_DETAIL_FUN_TEMPLATE_VARIADIC_TO_ARRAY(__VA_ARGS__) \
) \
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R = BOOST_TTI_NAMESPACE::detail::deftype,class BOOST_TTI_TP_FS = boost::mpl::vector<>,class BOOST_TTI_TP_TAG = boost::function_types::null_tag> \
struct trait \
{ \
typedef typename \
BOOST_PP_CAT(trait,_detail_hmft)<BOOST_TTI_TP_T,BOOST_TTI_TP_R,BOOST_TTI_TP_FS,BOOST_TTI_TP_TAG>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/
/// A macro which expands to a metafunction which tests whether an inner member function template with a particular name exists.
/**
BOOST_TTI_HAS_MEMBER_FUNCTION_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner member function template with a particular name exists.
The macro takes the form of BOOST_TTI_HAS_MEMBER_FUNCTION_TEMPLATE(name,...) where
name = inner member function template name <br/>
... = variadic parameters.
The variadic parameter(s) are either:
A sequence of valid instantiations for the member function template parameters
ie. 'int,long,double' etc.
or
A single variadic parameter which is a Boost PP array whose elements are
a sequence of valid instantiations for the member function template parameters
ie. '(3,(int,long,double))' etc. This form is allowed in order to be compatible
with using the non-variadic form of this macro.
BOOST_TTI_HAS_MEMBER_FUNCTION_TEMPLATE generates a metafunction called "has_member_function_template_'name'" where 'name' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct has_member_function_template_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
OR
a pointer to member function as a single type
which encapsulates a single instantiation of
the member function template.
BOOST_TTI_TP_R = (optional) the return type of the member function template
in a single instantiation of the member function template
if the first parameter is the enclosing type.
BOOST_TTI_TP_FS = (optional) the parameters of the member function template as a boost::mpl forward sequence
if the first parameter is the enclosing type and the member function template parameters
are not empty. These parameters are a single instantiation of the member function template.
BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the member function template
if the first parameter is the enclosing type and a tag is needed.
returns = 'value' is true if the 'name' exists,
with the appropriate member function template type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_HAS_MEMBER_FUNCTION_TEMPLATE(name,...) \
BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE \
( \
BOOST_TTI_HAS_MEMBER_FUNCTION_TEMPLATE_GEN(name), \
name, \
__VA_ARGS__ \
) \
/**/
#else // !BOOST_PP_VARIADICS
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// A macro which expands to a metafunction which tests whether an inner member function template with a particular name exists.
/**
BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner member function template with a particular name exists.
The macro takes the form of BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) where
trait = the name of the metafunction <br/>
name = inner member function template name <br/>
pparray = A Boost PP array whose elements are a sequence of valid instantiations for the
member function template parameters ie. '(3,(int,long,double))' etc.
BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE generates a metafunction called "trait" where 'trait' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct trait
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
OR
a pointer to member function as a single type
which encapsulates a single instantiation of
the member function template.
BOOST_TTI_TP_R = (optional) the return type of the member function template
in a single instantiation of the member function template
if the first parameter is the enclosing type.
BOOST_TTI_TP_FS = (optional) the parameters of the member function template as a boost::mpl forward sequence
if the first parameter is the enclosing type and the member function template parameters
are not empty. These parameters are a single instantiation of the member function template.
BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the member function template
if the first parameter is the enclosing type and a tag is needed.
returns = 'value' is true if the 'name' exists,
with the appropriate member function template type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R = BOOST_TTI_NAMESPACE::detail::deftype,class BOOST_TTI_TP_FS = boost::mpl::vector<>,class BOOST_TTI_TP_TAG = boost::function_types::null_tag> \
struct trait \
{ \
typedef typename \
BOOST_PP_CAT(trait,_detail_hmft)<BOOST_TTI_TP_T,BOOST_TTI_TP_R,BOOST_TTI_TP_FS,BOOST_TTI_TP_TAG>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/
/// A macro which expands to a metafunction which tests whether an inner member function template with a particular name exists.
/**
BOOST_TTI_HAS_MEMBER_FUNCTION_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner member function template with a particular name exists.
The macro takes the form of BOOST_TTI_HAS_MEMBER_FUNCTION_TEMPLATE(name,pparray) where
name = inner member function template name <br/>
pparray = A Boost PP array whose elements are a sequence of valid instantiations for the
member function template parameters ie. '(3,(int,long,double))' etc.
BOOST_TTI_HAS_MEMBER_FUNCTION_TEMPLATE generates a metafunction called "has_member_function_template_'name'" where 'name' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct has_member_function_template_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
OR
a pointer to member function as a single type
which encapsulates a single instantiation of
the member function template.
BOOST_TTI_TP_R = (optional) the return type of the member function template
in a single instantiation of the member function template
if the first parameter is the enclosing type.
BOOST_TTI_TP_FS = (optional) the parameters of the member function template as a boost::mpl forward sequence
if the first parameter is the enclosing type and the member function template parameters
are not empty. These parameters are a single instantiation of the member function template.
BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the member function template
if the first parameter is the enclosing type and a tag is needed.
returns = 'value' is true if the 'name' exists,
with the appropriate member function template type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_HAS_MEMBER_FUNCTION_TEMPLATE(name,pparray) \
BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION_TEMPLATE \
( \
BOOST_TTI_HAS_MEMBER_FUNCTION_TEMPLATE_GEN(name), \
name, \
pparray \
) \
/**/
#endif // BOOST_PP_VARIADICS
#endif // BOOST_TTI_MEMBER_FUNCTION_TEMPLATE_HPP

View File

@@ -21,28 +21,45 @@
/** \file
*/
/// Expands to a metafunction which tests whether a static member data with a particular name and type exists.
/// A macro which expands to a metafunction which tests whether a static member data with a particular name and type exists.
/**
trait = the name of the metafunction within the tti namespace.
BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA is a macro which expands to a metafunction.
The metafunction tests whether static member data with a particular
name and type exists. The macro takes the form of BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) where
trait = the name of the metafunction <br/>
name = the name of the inner member.
generates a metafunction called "trait" where 'trait' is the macro parameter.
BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA generates a metafunction called "trait" where 'trait' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE>
struct trait
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type.
The enclosing type can be a class, struct, or union.
If the type is a union, static member data can only
be found if the C++11 unrestricted union is implemented
by the compiler being used, since prior to C++11 a union
could not have static data members.
BOOST_TTI_TP_TYPE = the static member data type,
in the form of a data type,
in which to look for our 'name'.
BOOST_TTI_TP_TYPE = the type of the static member data.
returns = 'value' is true if the 'name' exists,
with the BOOST_TTI_TP_TYPE type,
within the enclosing BOOST_TTI_TP_T type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_DATA(trait,name) \
@@ -55,26 +72,44 @@
}; \
/**/
/// Expands to a metafunction which tests whether a static member data with a particular name and type exists.
/// A macro which expands to a metafunction which tests whether a static member data with a particular name and type exists.
/**
BOOST_TTI_HAS_STATIC_MEMBER_DATA is a macro which expands to a metafunction.
The metafunction tests whether static member data with a particular
name and type exists. The macro takes the form of BOOST_TTI_HAS_STATIC_MEMBER_DATA(name) where
name = the name of the inner member.
generates a metafunction called "has_static_member_data_name" where 'name' is the macro parameter.
BOOST_TTI_HAS_STATIC_MEMBER_DATA generates a metafunction called "has_static_member_data_name" where 'name' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE>
struct has_static_member_data_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type.
The enclosing type can be a class, struct, or union.
If the type is a union, static member data can only
be found if the C++11 unrestricted union is implemented
by the compiler being used, since prior to C++11 a union
could not have static data members.
BOOST_TTI_TP_TYPE = the static member data type,
in the form of a data type,
in which to look for our 'name'.
BOOST_TTI_TP_TYPE = the type of the static member data.
returns = 'value' is true if the 'name' exists,
with the appropriate BOOST_TTI_TP_TYPE type,
within the enclosing BOOST_TTI_TP_T type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_HAS_STATIC_MEMBER_DATA(name) \
BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA \

View File

@@ -23,15 +23,20 @@
/** \file
*/
/// Expands to a metafunction which tests whether a static member function with a particular name and signature exists.
/// A macro which expands to a metafunction which tests whether a static member function with a particular name and signature exists.
/**
trait = the name of the metafunction within the tti namespace.
BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION is a macro which expands to a metafunction.
The metafunction tests whether a static member function with a particular name
and signature exists. The macro takes the form of BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(trait,name) where
trait = the name of the metafunction <br/>
name = the name of the inner member.
generates a metafunction called "trait" where 'trait' is the macro parameter.
BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION generates a metafunction called "trait" where 'trait' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG>
struct trait
{
@@ -42,6 +47,7 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_R = the return type of the static member function
OR
@@ -57,6 +63,8 @@
with the appropriate static member function type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
@@ -69,15 +77,21 @@
}; \
/**/
/// Expands to a metafunction which tests whether a static member function with a particular name and signature exists.
/// A macro which expands to a metafunction which tests whether a static member function with a particular name and signature exists.
/**
BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION is a macro which expands to a metafunction.
The metafunction tests whether a static member function with a particular name
and signature exists. The macro takes the form of BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION(name) where
name = the name of the inner member.
generates a metafunction called "has_static_member_function_name" where 'name' is the macro parameter.
BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION generates a metafunction called "has_static_member_function_name" where 'name' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG>
struct trait
struct has_static_member_function_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
@@ -86,6 +100,7 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_R = the return type of the static member function
OR
@@ -101,6 +116,8 @@
with the appropriate static member function type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION(name) \
BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION \

View File

@@ -0,0 +1,306 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_STATIC_MEM_FUN_TEMPLATE_HPP)
#define BOOST_TTI_STATIC_MEM_FUN_TEMPLATE_HPP
#include <boost/config.hpp>
#include <boost/function_types/property_tags.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/tti/gen/has_static_member_function_template_gen.hpp>
#include <boost/tti/detail/dstatic_mem_fun_template.hpp>
#if BOOST_PP_VARIADICS
#include <boost/tti/detail/dmacro_fun_template.hpp>
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// A macro which expands to a metafunction which tests whether an inner static member function template with a particular name exists.
/**
BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner static member function template with a particular name exists.
The macro takes the form of BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,...) where
trait = the name of the metafunction <br/>
name = inner static member function template name <br/>
... = variadic parameters.
The variadic parameter(s) are either:
A sequence of valid instantiations for the static member function template parameters
ie. 'int,long,double' etc.
or
A single variadic parameter which is a Boost PP array whose elements are
a sequence of valid instantiations for the static member function template parameters
ie. '(3,(int,long,double))' etc. This form is allowed in order to be compatible
with using the non-variadic form of this macro.
BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE generates a metafunction called "trait" where 'trait' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct trait
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_R = the return type of the static member function template
in a single instantiation of the static member function template
OR
a pointer to function as a single type
which encapsulates a single instantiation of
the static member function template.
BOOST_TTI_TP_FS = (optional) the parameters of the static member function template as a boost::mpl forward sequence
if the second parameter is the enclosing type and the static member function template parameters
are not empty. These parameters are a single instantiation of the static member function template.
BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the static member function template
if the second parameter is the enclosing type and a tag is needed.
returns = 'value' is true if the 'name' exists,
with the appropriate static member function template type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,...) \
BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE \
( \
trait, \
name, \
BOOST_TTI_DETAIL_FUN_TEMPLATE_VARIADIC_TO_ARRAY(__VA_ARGS__) \
) \
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS = boost::mpl::vector<>,class BOOST_TTI_TP_TAG = boost::function_types::null_tag> \
struct trait \
{ \
typedef typename \
BOOST_PP_CAT(trait,_detail_hsmft)<BOOST_TTI_TP_T,BOOST_TTI_TP_R,BOOST_TTI_TP_FS,BOOST_TTI_TP_TAG>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/
/// A macro which expands to a metafunction which tests whether an inner static member function template with a particular name exists.
/**
BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner static member function template with a particular name exists.
The macro takes the form of BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(name,...) where
name = inner static member function template name <br/>
... = variadic parameters.
The variadic parameter(s) are either:
A sequence of valid instantiations for the static member function template parameters
ie. 'int,long,double' etc.
or
A single variadic parameter which is a Boost PP array whose elements are
a sequence of valid instantiations for the static member function template parameters
ie. '(3,(int,long,double))' etc. This form is allowed in order to be compatible
with using the non-variadic form of this macro.
BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE generates a metafunction called "has_static_member_function_template_'name'" where 'name' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct has_static_member_function_template_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_R = the return type of the static member function template
in a single instantiation of the static member function template
OR
a pointer to function as a single type
which encapsulates a single instantiation of
the static member function template.
BOOST_TTI_TP_FS = (optional) the parameters of the static member function template as a boost::mpl forward sequence
if the second parameter is the enclosing type and the static member function template parameters
are not empty. These parameters are a single instantiation of the static member function template.
BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the static member function template
if the second parameter is the enclosing type and a tag is needed.
returns = 'value' is true if the 'name' exists,
with the appropriate static member function template type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(name,...) \
BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE \
( \
BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE_GEN(name), \
name, \
__VA_ARGS__ \
) \
/**/
#else // !BOOST_PP_VARIADICS
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// A macro which expands to a metafunction which tests whether an inner static member function template with a particular name exists.
/**
BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner static member function template with a particular name exists.
The macro takes the form of BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) where
trait = the name of the metafunction <br/>
name = inner static member function template name <br/>
pparray = a Boost PP array whose elements are a sequence of valid instantiations for
the static member function template parameters ie. '(3,(int,long,double))' etc.
BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE generates a metafunction called "trait" where 'trait' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct trait
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_R = the return type of the static member function template
in a single instantiation of the static member function template
OR
a pointer to function as a single type
which encapsulates a single instantiation of
the static member function template.
BOOST_TTI_TP_FS = (optional) the parameters of the static member function template as a boost::mpl forward sequence
if the second parameter is the enclosing type and the static member function template parameters
are not empty. These parameters are a single instantiation of the static member function template.
BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the static member function template
if the second parameter is the enclosing type and a tag is needed.
returns = 'value' is true if the 'name' exists,
with the appropriate static member function template type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS = boost::mpl::vector<>,class BOOST_TTI_TP_TAG = boost::function_types::null_tag> \
struct trait \
{ \
typedef typename \
BOOST_PP_CAT(trait,_detail_hsmft)<BOOST_TTI_TP_T,BOOST_TTI_TP_R,BOOST_TTI_TP_FS,BOOST_TTI_TP_TAG>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/
/// A macro which expands to a metafunction which tests whether an inner static member function template with a particular name exists.
/**
BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner static member function template with a particular name exists.
The macro takes the form of BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(name,pparray) where
name = inner static member function template name <br/>
pparray = a Boost PP array whose elements are a sequence of valid instantiations for
the static member function template parameters ie. '(3,(int,long,double))' etc.
BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE generates a metafunction called "has_static_member_function_template_'name'" where 'name' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG>
struct has_static_member_function_template_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_R = the return type of the static member function template
in a single instantiation of the static member function template
OR
a pointer to function as a single type
which encapsulates a single instantiation of
the static member function template.
BOOST_TTI_TP_FS = (optional) the parameters of the static member function template as a boost::mpl forward sequence
if the second parameter is the enclosing type and the static member function template parameters
are not empty. These parameters are a single instantiation of the static member function template.
BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the static member function template
if the second parameter is the enclosing type and a tag is needed.
returns = 'value' is true if the 'name' exists,
with the appropriate static member function template type,
otherwise 'value' is false.
@endcode
*/
#define BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(name,pparray) \
BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE \
( \
BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE_GEN(name), \
name, \
pparray \
) \
/**/
#endif // BOOST_PP_VARIADICS
#endif // BOOST_TTI_STATIC_MEM_FUN_TEMPLATE_HPP

View File

@@ -4,6 +4,9 @@
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
#if !defined(BOOST_TTI_HAS_TEMPLATE_HPP)
#define BOOST_TTI_HAS_TEMPLATE_HPP
/*
The succeeding comments in this file are in doxygen format.
@@ -13,10 +16,6 @@
/** \file
*/
#if !defined(BOOST_TTI_HAS_TEMPLATE_HPP)
#define BOOST_TTI_HAS_TEMPLATE_HPP
#include <boost/config.hpp>
#include <boost/tti/gen/has_template_gen.hpp>
#include <boost/preprocessor/config/config.hpp>
#include <boost/preprocessor/control/iif.hpp>
@@ -28,39 +27,45 @@
#include <boost/preprocessor/variadic/size.hpp>
#include <boost/tti/detail/dvm_template_params.hpp>
/// Expands to a metafunction which tests whether an inner class template with a particular name exists.
/// A macro which expands to a metafunction which tests whether an inner class template with a particular name exists.
/**
trait = the name of the metafunction.
BOOST_TTI_TRAIT_HAS_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner class template with a particular name exists.
The macro takes the form of BOOST_TTI_TRAIT_HAS_TEMPLATE(trait,...) where
trait = the name of the metafunction <br/>
... = variadic parameters.
The first variadic parameter is the inner class template name.
Following variadic parameters are optional.
If no following variadic parameters exist, then the inner class template
being introspected must be all template type parameters ( template parameters
starting with `class` or `typename` ) and any number of template type parameters
can occur.
If the second variadic parameter is BOOST_PP_NIL and no other variadic
parameter is given, then just as in the previous case the inner class template
being introspected must be all template type parameters ( template parameters
starting with `class` or `typename` ) and any number of template type parameters
can occur. This form is allowed in order to be consistent with using the
non-variadic form of this macro.
If the second variadic parameter is a Boost preprocessor library array and no other
variadic parameter is given, then the inner class template must have its template
parameters matching the sequence in the tuple portion of the Boost PP array. This
form is allowed in order to be consistent with using the non-variadic form of this
macro.
Otherwise the inner class template must have its template parameters matching the
sequence of the optional variadic parameters.
The first variadic parameter is the inner class template name.
generates a metafunction called "trait" where 'trait' is the first macro parameter.
Following variadic parameters are optional.
If no following variadic parameters exist, then the inner class template
being introspected must be all template type parameters ( template parameters
starting with `class` or `typename` ) and any number of template type parameters
can occur.
If the second variadic parameter is BOOST_PP_NIL and no other variadic
parameter is given, then just as in the previous case the inner class template
being introspected must be all template type parameters ( template parameters
starting with `class` or `typename` ) and any number of template type parameters
can occur. This form is allowed in order to be consistent with using the
non-variadic form of this macro.
If the second variadic parameter is a Boost preprocessor library array and no other
variadic parameter is given, then the inner class template must have its template
parameters matching the sequence in the tuple portion of the Boost PP array. This
form is allowed in order to be consistent with using the non-variadic form of this
macro.
Otherwise the inner class template must have its template parameters matching the
sequence of the optional variadic parameters.
BOOST_TTI_TRAIT_HAS_TEMPLATE generates a metafunction called "trait" where 'trait' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T>
struct trait
{
@@ -71,12 +76,17 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
returns = 'value' is true if the 'name' template exists within the enclosing type,
otherwise 'value' is false.
@endcode
Examples:
@code
1) Search for an inner class template called 'MyTemplate', with all template type parameters,
nested within the class 'MyClass' using a metafunction name of 'MyMeta'.
@@ -106,6 +116,8 @@
is a compile time boolean constant which is either 'true' or 'false'
if the nested template exists.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_TEMPLATE(trait,...) \
BOOST_PP_IIF \
@@ -121,38 +133,44 @@
(trait,__VA_ARGS__) \
/**/
/// Expands to a metafunction which tests whether an inner class template with a particular name exists.
/// A macro which expands to a metafunction which tests whether an inner class template with a particular name exists.
/**
BOOST_TTI_HAS_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner class template with a particular name exists.
The macro takes the form of BOOST_TTI_HAS_TEMPLATE(...) where
... = variadic parameters.
The first variadic parameter is the inner class template name.
Following variadic parameters are optional.
If no following variadic parameters exist, then the inner class template
being introspected must be all template type parameters ( template parameters
starting with `class` or `typename` ) and any number of template type parameters
can occur.
If the second variadic parameter is BOOST_PP_NIL and no other variadic
parameter is given, then just as in the previous case the inner class template
being introspected must be all template type parameters ( template parameters
starting with `class` or `typename` ) and any number of template type parameters
can occur. This form is allowed in order to be consistent with using the
non-variadic form of this macro.
If the second variadic parameter is a Boost preprocessor library array and no other
variadic parameter is given, then the inner class template must have its template
parameters matching the sequence in the tuple portion of the Boost PP array. This
form is allowed in order to be consistent with using the non-variadic form of this
macro.
Otherwise the inner class template must have its template parameters matching the
sequence of the optional variadic parameters.
The first variadic parameter is the inner class template name.
generates a metafunction called "has_template_'name'" where 'name' is the first variadic parameter.
Following variadic parameters are optional.
If no following variadic parameters exist, then the inner class template
being introspected must be all template type parameters ( template parameters
starting with `class` or `typename` ) and any number of template type parameters
can occur.
If the second variadic parameter is BOOST_PP_NIL and no other variadic
parameter is given, then just as in the previous case the inner class template
being introspected must be all template type parameters ( template parameters
starting with `class` or `typename` ) and any number of template type parameters
can occur. This form is allowed in order to be consistent with using the
non-variadic form of this macro.
If the second variadic parameter is a Boost preprocessor library array and no other
variadic parameter is given, then the inner class template must have its template
parameters matching the sequence in the tuple portion of the Boost PP array. This
form is allowed in order to be consistent with using the non-variadic form of this
macro.
Otherwise the inner class template must have its template parameters matching the
sequence of the optional variadic parameters.
BOOST_TTI_HAS_TEMPLATE generates a metafunction called "has_template_'name'" where 'name' is the first variadic parameter.
@code
template<class BOOST_TTI_TP_T>
struct has_template_'name'
{
@@ -163,12 +181,17 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
returns = 'value' is true if the 'name' template exists within the enclosing type,
otherwise 'value' is false.
@endcode
Examples:
@code
1) Search for an inner class template called 'MyTemplate', with all template type parameters,
nested within the class 'MyClass'.
@@ -197,6 +220,8 @@
is a compile time boolean constant which is either 'true' or 'false'
if the nested template exists.
@endcode
*/
#define BOOST_TTI_HAS_TEMPLATE(...) \
BOOST_TTI_TRAIT_HAS_TEMPLATE \
@@ -215,24 +240,30 @@
#include <boost/tti/detail/dtemplate.hpp>
#include <boost/tti/detail/dtemplate_params.hpp>
/// Expands to a metafunction which tests whether an inner class template with a particular name exists.
/// A macro which expands to a metafunction which tests whether an inner class template with a particular name exists.
/**
trait = the name of the metafunction.
name = the inner class template name.
BOOST_TTI_TRAIT_HAS_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner class template with a particular name exists.
The macro takes the form of BOOST_TTI_TRAIT_HAS_TEMPLATE(trait,name,params) where
trait = the name of the metafunction <br/>
name = the inner class template name <br/>
params = If the parameter is BOOST_PP_NIL the inner class template
being introspected must be all template type parameters ( template parameters
starting with `class` or `typename` ) and any number of template type parameters
can occur.
If the parameter is a Boost preprocessor library array, then the inner class
template must have its template parameters matching the sequence in the tuple portion
of the Boost PP array.
Otherwise a compiler error occurs.
If the parameter is a Boost preprocessor library array, then the inner class
template must have its template parameters matching the sequence in the tuple portion
of the Boost PP array.
generates a metafunction called "trait" where 'trait' is the first macro parameter.
If the parameter is anything else a compiler error occurs.
BOOST_TTI_TRAIT_HAS_TEMPLATE generates a metafunction called "trait" where 'trait' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T>
struct trait
{
@@ -243,12 +274,17 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
returns = 'value' is true if the 'name' template exists within the enclosing type,
otherwise 'value' is false.
@endcode
Examples:
@code
1) Search for an inner class template called 'MyTemplate', with all template type parameters,
nested within the class 'MyClass' using a metafunction name of 'MyMeta'.
@@ -270,6 +306,8 @@
is a compile time boolean constant which is either 'true' or 'false'
if the nested template exists.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_TEMPLATE(trait,name,params) \
BOOST_PP_IIF \
@@ -281,25 +319,31 @@
(trait,name,params) \
/**/
/// Expands to a metafunction which tests whether an inner class template with a particular name exists.
/// A macro which expands to a metafunction which tests whether an inner class template with a particular name exists.
/**
name = the inner class template name.
BOOST_TTI_HAS_TEMPLATE is a macro which expands to a metafunction.
The metafunction tests whether an inner class template with a particular name exists.
The macro takes the form of BOOST_TTI_HAS_TEMPLATE(name,params) where
name = the inner class template name <br/>
params = If the parameter is BOOST_PP_NIL the inner class template
being introspected must be all template type parameters ( template parameters
starting with `class` or `typename` ) and any number of template type parameters
can occur.
If the parameter is a Boost preprocessor library array, then the inner class
template must have its template parameters matching the sequence in the tuple portion
of the Boost PP array.
Otherwise a compiler error occurs.
If the parameter is a Boost preprocessor library array, then the inner class
template must have its template parameters matching the sequence in the tuple portion
of the Boost PP array.
generates a metafunction called "has_template_'name'" where 'name' is the first macro parameter.
If the parameter is anything else a compiler error occurs.
BOOST_TTI_HAS_TEMPLATE generates a metafunction called "has_template_'name'" where 'name' is the first macro parameter.
@code
template<class BOOST_TTI_TP_T>
struct trait
struct has_template_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
@@ -308,12 +352,17 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
returns = 'value' is true if the 'name' template exists within the enclosing type,
otherwise 'value' is false.
@endcode
Examples:
@code
1) Search for an inner class template called 'MyTemplate', with all template type parameters,
nested within the class 'MyClass'.
@@ -334,6 +383,8 @@
is a compile time boolean constant which is either 'true' or 'false'
if the nested template exists.
@endcode
*/
#define BOOST_TTI_HAS_TEMPLATE(name,params) \
BOOST_TTI_TRAIT_HAS_TEMPLATE \

View File

@@ -23,19 +23,21 @@
/** \file
*/
/// A macro which expands to a metafunction which tests whether an inner type with a particular name exists.
/**
BOOST_TTI_TRAIT_HAS_TYPE is a macro which expands to a metafunction.
The metafunction tests whether an inner type with a particular name exists
and, optionally, whether a lambda expression invoked with the inner type
is true or not.
trait = the name of the metafunction within the tti namespace.
and, optionally, whether an MPL lambda expression invoked with the inner type
is true or not. The macro takes the form of BOOST_TTI_TRAIT_HAS_TYPE(trait,name) where
trait = the name of the metafunction <br/>
name = the name of the inner type.
generates a metafunction called "trait" where 'trait' is the macro parameter.
BOOST_TTI_TRAIT_HAS_TYPE generates a metafunction called "trait" where 'trait' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_U>
struct trait
{
@@ -46,6 +48,7 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_U = (optional) An optional template parameter, defaulting to a marker type.
If specified it is an MPL lambda expression which is invoked
@@ -58,15 +61,19 @@
exists within the enclosing type BOOST_TTI_TP_T; otherwise 'value' is false.
If BOOST_TTI_TP_U is specified , then 'value' is true if the 'name' type exists
within the enclosing type BOOST_TTI_TP_T and the lambda expression as specified
within the enclosing type BOOST_TTI_TP_T and the MPL lambda expression as specified
by BOOST_TTI_TP_U, invoked by passing the actual inner type of 'name', returns
a 'value' of true; otherwise 'value' is false.
The action taken with BOOST_TTI_TP_U occurs only when the 'name' type exists
within the enclosing type BOOST_TTI_TP_T.
@endcode
Example usage:
@code
BOOST_TTI_TRAIT_HAS_TYPE(LookFor,MyType) generates the metafunction LookFor in the current scope
to look for an inner type called MyType.
@@ -81,6 +88,8 @@
LookFor<EnclosingType,boost::is_same<_,SomeOtherType> >::value is true if MyType is an inner type
of EnclosingType and is the same type as SomeOtherType.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_TYPE(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_TYPE(trait,name) \
@@ -97,17 +106,20 @@
}; \
/**/
/// A macro which expands to a metafunction which tests whether an inner type with a particular name exists.
/**
BOOST_TTI_HAS_TYPE is a macro which expands to a metafunction.
The metafunction tests whether an inner type with a particular name exists
and, optionally, whether a lambda expression invoked with the inner type
is true or not.
and, optionally, whether an MPL lambda expression invoked with the inner type
is true or not. The macro takes the form of BOOST_TTI_HAS_TYPE(name) where
name = the name of the inner type.
generates a metafunction called "has_type_'name'" where 'name' is the macro parameter.
BOOST_TTI_HAS_TYPE generates a metafunction called "has_type_'name'" where 'name' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_U>
struct has_type_'name'
{
@@ -118,6 +130,7 @@
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_U = (optional) An optional template parameter, defaulting to a marker type.
If specified it is an MPL lambda expression which is invoked
@@ -130,15 +143,19 @@
exists within the enclosing type BOOST_TTI_TP_T; otherwise 'value' is false.
If BOOST_TTI_TP_U is specified , then 'value' is true if the 'name' type exists
within the enclosing type BOOST_TTI_TP_T and the lambda expression as specified
within the enclosing type BOOST_TTI_TP_T and the MPL lambda expression as specified
by BOOST_TTI_TP_U, invoked by passing the actual inner type of 'name', returns
a 'value' of true; otherwise 'value' is false.
The action taken with BOOST_TTI_TP_U occurs only when the 'name' type exists
within the enclosing type BOOST_TTI_TP_T.
@endcode
Example usage:
@code
BOOST_TTI_HAS_TYPE(MyType) generates the metafunction has_type_MyType in the current scope
to look for an inner type called MyType.
@@ -152,6 +169,8 @@
has_type_MyType<EnclosingType,boost::is_same<_,SomeOtherType> >::value is true if MyType is an inner type
of EnclosingType and is the same type as SomeOtherType.
@endcode
*/
#define BOOST_TTI_HAS_TYPE(name) \

View File

@@ -0,0 +1,183 @@
// (C) Copyright Edward Diener 2019
// Use, modification and distribution are subject to 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).
#if !defined(BOOST_TTI_HAS_UNION_HPP)
#define BOOST_TTI_HAS_UNION_HPP
#include <boost/config.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/tti/gen/has_union_gen.hpp>
#include <boost/tti/gen/namespace_gen.hpp>
#include <boost/tti/detail/dunion.hpp>
#include <boost/tti/detail/ddeftype.hpp>
/*
The succeeding comments in this file are in doxygen format.
*/
/** \file
*/
/// A macro which expands to a metafunction which tests whether an inner union with a particular name exists.
/**
BOOST_TTI_TRAIT_HAS_UNION is a macro which expands to a metafunction.
The metafunction tests whether an inner union with a particular name exists
and, optionally, whether an MPL lambda expression invoked with the inner union
is true or not. The macro takes the form of BOOST_TTI_TRAIT_HAS_UNION(trait,name) where
trait = the name of the metafunction <br/>
name = the name of the inner union.
BOOST_TTI_TRAIT_HAS_UNION generates a metafunction called "trait" where 'trait' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_U>
struct trait
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
The enclosing type can be a class, struct, or union.
BOOST_TTI_TP_U = (optional) An optional template parameter, defaulting to a marker type.
If specified it is an MPL lambda expression which is invoked
with the inner union found and must return a constant boolean
value.
returns = 'value' depends on whether or not the optional BOOST_TTI_TP_U is specified.
If BOOST_TTI_TP_U is not specified, then 'value' is true if the 'name' union
exists within the enclosing type BOOST_TTI_TP_T; otherwise 'value' is false.
If BOOST_TTI_TP_U is specified , then 'value' is true if the 'name' union exists
within the enclosing type BOOST_TTI_TP_T and the MPL lambda expression as specified
by BOOST_TTI_TP_U, invoked by passing the actual inner union of 'name', returns
a 'value' of true; otherwise 'value' is false.
The action taken with BOOST_TTI_TP_U occurs only when the 'name' union exists
within the enclosing type BOOST_TTI_TP_T.
@endcode
Example usage:
@code
BOOST_TTI_TRAIT_HAS_UNION(LookFor,MyType) generates the metafunction LookFor in the current scope
to look for an inner union called MyType.
LookFor<EnclosingType>::value is true if MyType is an inner union of EnclosingType, otherwise false.
LookFor<EnclosingType,ALambdaExpression>::value is true if MyType is an inner union of EnclosingType
and invoking ALambdaExpression with the inner union returns a value of true, otherwise false.
A popular use of the optional MPL lambda expression is to check whether the union found is the same
as another type, when the union found is a typedef. In that case our example would be:
LookFor<EnclosingType,boost::is_same<_,SomeOtherType> >::value is true if MyType is an inner union
of EnclosingType and is the same type as SomeOtherType.
@endcode
*/
#define BOOST_TTI_TRAIT_HAS_UNION(trait,name) \
BOOST_TTI_DETAIL_TRAIT_HAS_UNION(trait,name) \
template \
< \
class BOOST_TTI_TP_T, \
class BOOST_TTI_TP_U = BOOST_TTI_NAMESPACE::detail::deftype \
> \
struct trait \
{ \
typedef typename \
BOOST_PP_CAT(trait,_detail_union)<BOOST_TTI_TP_T,BOOST_TTI_TP_U>::type type; \
BOOST_STATIC_CONSTANT(bool,value=type::value); \
}; \
/**/
/// A macro which expands to a metafunction which tests whether an inner union with a particular name exists.
/**
BOOST_TTI_HAS_UNION is a macro which expands to a metafunction.
The metafunction tests whether an inner union with a particular name exists
and, optionally, whether an MPL lambda expression invoked with the inner union
is true or not. The macro takes the form of BOOST_TTI_HAS_UNION(name) where
name = the name of the inner union.
BOOST_TTI_HAS_UNION generates a metafunction called "has_union_'name'" where 'name' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_U>
struct has_union_'name'
{
static const value = unspecified;
typedef mpl::bool_<true-or-false> type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
BOOST_TTI_TP_U = (optional) An optional template parameter, defaulting to a marker type.
If specified it is an MPL lambda expression which is invoked
with the inner union found and must return a constant boolean
value.
returns = 'value' depends on whether or not the optional BOOST_TTI_TP_U is specified.
If BOOST_TTI_TP_U is not specified, then 'value' is true if the 'name' union
exists within the enclosing type BOOST_TTI_TP_T; otherwise 'value' is false.
If BOOST_TTI_TP_U is specified, then 'value' is true if the 'name' union exists
within the enclosing type BOOST_TTI_TP_T and the MPL lambda expression as specified
by BOOST_TTI_TP_U, invoked by passing the actual inner union of 'name', returns
a 'value' of true; otherwise 'value' is false.
The action taken with BOOST_TTI_TP_U occurs only when the 'name' union exists
within the enclosing type BOOST_TTI_TP_T.
@endcode
Example usage:
@code
BOOST_TTI_HAS_UNION(MyType) generates the metafunction has_union_MyType in the current scope
to look for an inner union called MyType.
has_union_MyType<EnclosingType>::value is true if MyType is an inner union of EnclosingType, otherwise false.
has_class_MyType<EnclosingType,ALambdaExpression>::value is true if MyType is an inner union of EnclosingType
and invoking ALambdaExpression with the inner union returns a value of true, otherwise false.
A popular use of the optional MPL lambda expression is to check whether the union found is the same
as another type, when the union found is a typedef. In that case our example would be:
has_union_MyType<EnclosingType,boost::is_same<_,SomeOtherType> >::value is true if MyType is an inner union
of EnclosingType and is the same type as SomeOtherType.
@endcode
*/
#define BOOST_TTI_HAS_UNION(name) \
BOOST_TTI_TRAIT_HAS_UNION \
( \
BOOST_TTI_HAS_UNION_GEN(name), \
name \
) \
/**/
#endif // BOOST_TTI_HAS_UNION_HPP

View File

@@ -7,7 +7,6 @@
#if !defined(BOOST_TTI_MEMBER_TYPE_HPP)
#define BOOST_TTI_MEMBER_TYPE_HPP
#include <boost/config.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/not.hpp>
@@ -27,37 +26,47 @@
/** \file
*/
/// Expands to a metafunction whose typedef 'type' is either the named type or a marker type.
/// A macro expands to a metafunction whose typedef 'type' is either the named type or a marker type.
/**
trait = the name of the metafunction within the tti namespace.
BOOST_TTI_TRAIT_MEMBER_TYPE is a macro which expands to a metafunction.
The metafunction tests whether an inner type with a particular name exists
by returning the inner type or a marker type.
The macro takes the form of BOOST_TTI_TRAIT_MEMBER_TYPE(trait,name) where
trait = the name of the metafunction <br/>
name = the name of the inner type.
generates a metafunction called "trait" where 'trait' is the macro parameter.
BOOST_TTI_TRAIT_MEMBER_TYPE generates a metafunction called "trait" where 'trait' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_MARKER_TYPE = boost::tti::detail::notype>
struct trait
{
typedef unspecified type;
typedef BOOST_TTI_TP_MARKER_TYPE boost_tti_marker_type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type.
BOOST_TTI_TP_MARKER_TYPE = (optional) a type to use as the marker type.
defaults to the internal boost::tti::detail::notype.
The enclosing type can be a class, struct, or union.
returns = 'type' is the inner type of 'name' if the inner type exists
within the enclosing type, else 'type' is a marker type.
if the end-user does not specify a marker type then
an internal boost::tti::detail::notype marker type is used.
BOOST_TTI_TP_MARKER_TYPE = (optional) a type to use as the marker type.
defaults to the internal boost::tti::detail::notype.
returns = 'type' is the inner type of 'name' if the inner type exists
within the enclosing type, else 'type' is a marker type.
if the end-user does not specify a marker type then
an internal boost::tti::detail::notype marker type,
which is empty, is used.
The metafunction also encapsulates the type of the marker type as
a nested 'boost_tti_marker_type'.
@endcode
The purpose of this macro is to encapsulate the 'name' type as the typedef 'type'
of a metafunction, but only if it exists within the enclosing type. This allows for
an evaluation of inner type existence, without generating a compiler error,
@@ -71,7 +80,7 @@
struct trait : \
boost::mpl::eval_if \
< \
BOOST_PP_CAT(trait,_detail)<BOOST_TTI_TP_T>, \
BOOST_PP_CAT(trait,_detail_has_type_member_type)<BOOST_TTI_TP_T>, \
BOOST_PP_CAT(trait,_detail_member_type)<BOOST_TTI_TP_T>, \
boost::mpl::identity<BOOST_TTI_TP_MARKER_TYPE> \
> \
@@ -80,35 +89,45 @@
}; \
/**/
/// Expands to a metafunction whose typedef 'type' is either the named type or a marker type.
/// A macro which expands to a metafunction whose typedef 'type' is either the named type or a marker type.
/**
BOOST_TTI_MEMBER_TYPE is a macro which expands to a metafunction.
The metafunction tests whether an inner type with a particular name exists
by returning the inner type or a marker type.
The macro takes the form of BOOST_TTI_MEMBER_TYPE(name) where
name = the name of the inner type.
generates a metafunction called "member_type_name" where 'name' is the macro parameter.
BOOST_TTI_MEMBER_TYPE generates a metafunction called "member_type_name" where 'name' is the macro parameter.
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_MARKER_TYPE = boost::tti::detail::notype>
struct member_type_name
struct member_type_'name'
{
typedef unspecified type;
typedef BOOST_TTI_TP_MARKER_TYPE boost_tti_marker_type;
};
The metafunction types and return:
BOOST_TTI_TP_T = the enclosing type.
BOOST_TTI_TP_MARKER_TYPE = (optional) a type to use as the marker type.
defaults to the internal boost::tti::detail::notype.
The enclosing type can be a class, struct, or union.
returns = 'type' is the inner type of 'name' if the inner type exists
within the enclosing type, else 'type' is a marker type.
if the end-user does not specify a marker type then
an internal boost::tti::detail::notype marker type is used.
BOOST_TTI_TP_MARKER_TYPE = (optional) a type to use as the marker type.
defaults to the internal boost::tti::detail::notype.
returns = 'type' is the inner type of 'name' if the inner type exists
within the enclosing type, else 'type' is a marker type.
if the end-user does not specify a marker type then
an internal boost::tti::detail::notype marker type is used.
The metafunction also encapsulates the type of the marker type as
a nested 'boost_tti_marker_type'.
@endcode
The purpose of this macro is to encapsulate the 'name' type as the typedef 'type'
of a metafunction, but only if it exists within the enclosing type. This allows for
an evaluation of inner type existence, without generating a compiler error,
@@ -130,7 +149,11 @@ namespace boost
/// A metafunction which checks whether the member 'type' returned from invoking the macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ) is a valid type.
/**
The metafunction 'valid_member_type', which is in the boost::tti namespace, takes the form of:
@code
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_MARKER_TYPE = boost::tti::detail::notype>
struct valid_member_type
{
@@ -141,12 +164,15 @@ namespace boost
The metafunction types and return:
BOOST_TTI_TP_T = returned inner 'type' from invoking the macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ).
BOOST_TTI_TP_MARKER_TYPE = (optional) a type to use as the marker type.
defaults to the internal boost::tti::detail::notype.
defaults to the internal boost::tti::detail::notype.
returns = 'value' is true if the type is valid, otherwise 'value' is false.
A valid type means that the returned inner 'type' is not the marker type.
returns = 'value' is true if the type is valid, otherwise 'value' is false.
A valid type means that the returned inner 'type' is not the marker type.
@endcode
*/
template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_MARKER_TYPE = BOOST_TTI_NAMESPACE::detail::notype>
struct valid_member_type :
@@ -160,7 +186,11 @@ namespace boost
/// A metafunction which checks whether the invoked macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ) hold a valid type.
/**
template<class TTI_METAFUNCTION>
The metafunction 'valid_member_metafunction', which is in the boost::tti namespace, takes the form of:
@code
template<class BOOST_TTI_METAFUNCTION>
struct valid_member_metafunction
{
static const value = unspecified;
@@ -169,17 +199,19 @@ namespace boost
The metafunction types and return:
TTI_METAFUNCTION = The invoked macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ).
BOOST_TTI_METAFUNCTION = The invoked macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ).
returns = 'value' is true if the nested type of the invoked metafunction is valid, otherwise 'value' is false.
A valid type means that the invoked metafunction's inner 'type' is not the marker type.
returns = 'value' is true if the nested type of the invoked metafunction is valid, otherwise 'value' is false.
A valid type means that the invoked metafunction's inner 'type' is not the marker type.
@endcode
*/
template<class TTI_METAFUNCTION>
template<class BOOST_TTI_METAFUNCTION>
struct valid_member_metafunction :
boost::mpl::not_
<
boost::is_same<typename TTI_METAFUNCTION::type,typename TTI_METAFUNCTION::boost_tti_marker_type>
boost::is_same<typename BOOST_TTI_METAFUNCTION::type,typename BOOST_TTI_METAFUNCTION::boost_tti_marker_type>
>
{
};

View File

@@ -1,5 +1,5 @@
// (C) Copyright Edward Diener 2011,2012
// (C) Copyright Edward Diener 2011,2012,2019
// Use, modification and distribution are subject to 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).
@@ -7,14 +7,20 @@
#if !defined(BOOST_TTI_INTROSPECTION_HPP)
#define BOOST_TTI_INTROSPECTION_HPP
#include "has_class.hpp"
#include "has_data.hpp"
#include "has_enum.hpp"
#include "has_function.hpp"
#include "has_function_template.hpp"
#include "has_member_data.hpp"
#include "has_member_function.hpp"
#include "has_member_function_template.hpp"
#include "has_static_member_data.hpp"
#include "has_static_member_function.hpp"
#include "has_static_member_function_template.hpp"
#include "has_template.hpp"
#include "has_type.hpp"
#include "has_union.hpp"
#include "member_type.hpp"
#endif // BOOST_TTI_INTROSPECTION_HPP