alignment_of_msvc.hpp 627 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. Copyright 2014-2015 Glen Joseph Fernandes
  3. (glenjofe@gmail.com)
  4. Distributed under the Boost Software License, Version 1.0.
  5. (http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_MSVC_HPP
  8. #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_MSVC_HPP
  9. #include <boost/align/detail/min_size.hpp>
  10. namespace boost {
  11. namespace alignment {
  12. namespace detail {
  13. template<class T>
  14. struct offset_value {
  15. T first;
  16. char value;
  17. T second;
  18. };
  19. template<class T>
  20. struct alignment_of
  21. : min_size<sizeof(T), sizeof(offset_value<T>) - (sizeof(T) << 1)> { };
  22. } /* detail */
  23. } /* alignment */
  24. } /* boost */
  25. #endif