test_has_template_compile.cpp 838 B

12345678910111213141516171819202122232425262728
  1. // (C) Copyright Edward Diener 2011
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. #include "test_has_template.hpp"
  6. #include <boost/mpl/assert.hpp>
  7. int main()
  8. {
  9. // You can always instantiate without compiler errors
  10. BOOST_TTI_HAS_TEMPLATE_GEN(AMemberTemplate)<AnotherType> aVar;
  11. HaveAnotherMT<AnotherType> aVar2;
  12. BOOST_TTI_HAS_TEMPLATE_GEN(SomeMemberTemplate)<AType> aVar3;
  13. BOOST_TTI_HAS_TEMPLATE_GEN(TemplateNotExist)<AType> aVar4;
  14. // Compile time asserts
  15. BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(ATPMemberTemplate)<AType>));
  16. BOOST_MPL_ASSERT((HaveCL<AType>));
  17. BOOST_MPL_ASSERT((BOOST_TTI_HAS_TEMPLATE_GEN(SimpleTMP)<AnotherType>));
  18. return 0;
  19. }