type_index_test_ctti_alignment.cpp 594 B

123456789101112131415161718
  1. //
  2. // Copyright 2012-2019 Antony Polukhin.
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See
  5. // accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #include <boost/type_index/ctti_type_index.hpp>
  8. #include <boost/type_traits/alignment_of.hpp>
  9. int main() {
  10. BOOST_STATIC_ASSERT_MSG(
  11. boost::alignment_of<boost::typeindex::detail::ctti_data>::value == boost::alignment_of<char>::value,
  12. "Alignments of boost::typeindex::detail::ctti_data and char differ. "
  13. "It is unsafe to reinterpret_cast between them."
  14. );
  15. }