test_has_static_mem_data.cpp 941 B

12345678910111213141516171819202122232425
  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_static_mem_data.hpp"
  6. #include <boost/detail/lightweight_test.hpp>
  7. int main()
  8. {
  9. BOOST_TEST((BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(DSMember)<AType,short>::value));
  10. BOOST_TEST((!BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(SomeStaticData)<AnotherType,float>::value));
  11. BOOST_TEST((StatName<AnotherType,AType::AStructType>::value));
  12. BOOST_TEST((BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(CIntValue)<AnotherType,const int>::value));
  13. // Passing non-class enclosing type will return false
  14. BOOST_TEST((!BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN(DSMember)<unsigned short,short>::value));
  15. BOOST_TEST((!StatName<AnotherType *,AType::AStructType>::value));
  16. return boost::report_errors();
  17. }