// (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 #include #include #include #include #include #include #include #include #include #include #define BOOST_TTI_DETAIL_TRAIT_INVOKE_HAS_CLASS(trait,name) \ template \ struct BOOST_PP_CAT(trait,_detail_class_invoke) \ { \ BOOST_MPL_ASSERT((BOOST_TTI_NAMESPACE::detail::is_lambda_expression)); \ typedef typename boost::mpl::apply::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 \ struct BOOST_PP_CAT(trait,_detail_class_op_choose) : \ boost::mpl::and_ \ < \ boost::is_class, \ BOOST_PP_CAT(trait,_detail_class_invoke) \ > \ { \ }; \ \ template \ struct BOOST_PP_CAT(trait,_detail_class_op_choose) : \ boost::mpl::false_ \ { \ }; \ \ template \ struct BOOST_PP_CAT(trait,_detail_class_op_choose) : \ boost::is_class \ { \ }; \ /**/ #define BOOST_TTI_DETAIL_TRAIT_HAS_CLASS_OP(trait,name) \ BOOST_TTI_DETAIL_TRAIT_HAS_CLASS_OP_CHOOSE(trait,name) \ template \ 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)::type \ > \ { \ }; \ /**/ #define BOOST_TTI_DETAIL_TRAIT_HAS_CLASS(trait,name) \ BOOST_TTI_DETAIL_TRAIT_HAS_CLASS_OP(trait,name) \ template \ struct BOOST_PP_CAT(trait,_detail_class) : \ boost::mpl::eval_if \ < \ BOOST_TTI_NAMESPACE::detail::enclosing_type, \ BOOST_PP_CAT(trait,_detail_class_op), \ boost::mpl::false_ \ > \ { \ }; \ /**/ #endif // BOOST_TTI_DETAIL_CLASS_HPP