is_aligned.hpp 506 B

123456789101112131415161718192021222324252627
  1. /*
  2. Copyright 2014 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_IS_ALIGNED_HPP
  8. #define BOOST_ALIGN_IS_ALIGNED_HPP
  9. #include <boost/align/detail/is_aligned.hpp>
  10. namespace boost {
  11. namespace alignment {
  12. BOOST_CONSTEXPR inline bool
  13. is_aligned(std::size_t value, std::size_t alignment) BOOST_NOEXCEPT
  14. {
  15. return (value & (alignment - 1)) == 0;
  16. }
  17. } /* alignment */
  18. } /* boost */
  19. #endif