mirror of
https://github.com/boostorg/tti.git
synced 2026-02-01 21:12:08 +00:00
84 lines
2.4 KiB
C++
84 lines
2.4 KiB
C++
#include "test_mf_has_template.hpp"
|
|
#include <boost/mpl/assert.hpp>
|
|
|
|
int main()
|
|
{
|
|
|
|
using namespace boost::mpl::placeholders;
|
|
|
|
// You can always instantiate without compiler errors
|
|
|
|
boost::tti::mf_has_template
|
|
<
|
|
BOOST_TTI_HAS_TEMPLATE_GEN(TemplateNotExist)<_>,
|
|
BOOST_TTI_TRAIT_GEN(MT_BType)<AType>
|
|
> aVar;
|
|
|
|
boost::tti::mf_has_template
|
|
<
|
|
BOOST_TTI_MTFC_HAS_TEMPLATE_GEN(ATPMemberTemplate),
|
|
boost::mpl::identity<AnotherType>
|
|
> aVar2;
|
|
|
|
// Compile time asserts
|
|
|
|
BOOST_MPL_ASSERT((boost::tti::mf_has_template
|
|
<
|
|
BOOST_TTI_TRAIT_GEN(HaveMStr)<_>,
|
|
BOOST_TTI_MEMBER_TYPE_GEN(AStructType)<AType>
|
|
>
|
|
));
|
|
|
|
BOOST_MPL_ASSERT((boost::tti::mf_has_template
|
|
<
|
|
BOOST_TTI_HAS_TEMPLATE_GEN(ATPMemberTemplate)<_>,
|
|
boost::mpl::identity<AType>
|
|
>
|
|
));
|
|
|
|
BOOST_MPL_ASSERT((boost::tti::mf_has_template
|
|
<
|
|
BOOST_TTI_TRAIT_GEN(HaveCL)<_>,
|
|
boost::mpl::identity<AType>
|
|
>
|
|
));
|
|
|
|
BOOST_MPL_ASSERT((boost::tti::mf_has_template
|
|
<
|
|
BOOST_TTI_HAS_TEMPLATE_GEN(SimpleTMP)<_>,
|
|
boost::mpl::identity<AnotherType>
|
|
>
|
|
));
|
|
|
|
BOOST_MPL_ASSERT((boost::tti::mf_has_template
|
|
<
|
|
BOOST_TTI_TRAIT_GEN(MetaHaveMStr),
|
|
BOOST_TTI_MEMBER_TYPE_GEN(AStructType)<AType>
|
|
>
|
|
));
|
|
|
|
BOOST_MPL_ASSERT((boost::tti::mf_has_template
|
|
<
|
|
BOOST_TTI_MTFC_HAS_TEMPLATE_GEN(ATPMemberTemplate),
|
|
boost::mpl::identity<AType>
|
|
>
|
|
));
|
|
|
|
BOOST_MPL_ASSERT((boost::tti::mf_has_template
|
|
<
|
|
BOOST_TTI_TRAIT_GEN(MFClassHaveCL),
|
|
boost::mpl::identity<AType>
|
|
>
|
|
));
|
|
|
|
BOOST_MPL_ASSERT((boost::tti::mf_has_template
|
|
<
|
|
BOOST_TTI_MTFC_HAS_TEMPLATE_GEN(SimpleTMP),
|
|
boost::mpl::identity<AnotherType>
|
|
>
|
|
));
|
|
|
|
return 0;
|
|
|
|
}
|