is_alignment_constant.hpp 579 B

1234567891011121314151617181920212223242526
  1. /*
  2. Copyright 2014 Glen Joseph Fernandes
  3. ([email protected])
  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_IS_ALIGNMENT_CONSTANT_HPP
  8. #define BOOST_ALIGN_DETAIL_IS_ALIGNMENT_CONSTANT_HPP
  9. #include <boost/align/detail/integral_constant.hpp>
  10. #include <cstddef>
  11. namespace boost {
  12. namespace alignment {
  13. namespace detail {
  14. template<std::size_t N>
  15. struct is_alignment_constant
  16. : integral_constant<bool, (N > 0) && ((N & (N - 1)) == 0)> { };
  17. } /* detail */
  18. } /* alignment */
  19. } /* boost */
  20. #endif