Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:26

0001 /*
0002 Copyright 2014 Glen Joseph Fernandes
0003 (glenjofe@gmail.com)
0004 
0005 Distributed under the Boost Software License, Version 1.0.
0006 (http://www.boost.org/LICENSE_1_0.txt)
0007 */
0008 #ifndef BOOST_ALIGN_DETAIL_IS_ALIGNED_HPP
0009 #define BOOST_ALIGN_DETAIL_IS_ALIGNED_HPP
0010 
0011 #include <boost/align/detail/is_alignment.hpp>
0012 #include <boost/assert.hpp>
0013 
0014 namespace boost {
0015 namespace alignment {
0016 
0017 inline bool
0018 is_aligned(const volatile void* ptr, std::size_t alignment) BOOST_NOEXCEPT
0019 {
0020     BOOST_ASSERT(detail::is_alignment(alignment));
0021     return (reinterpret_cast<std::size_t>(ptr) & (alignment - 1)) == 0;
0022 }
0023 
0024 inline bool
0025 is_aligned(std::size_t alignment, const volatile void* ptr) BOOST_NOEXCEPT
0026 {
0027     BOOST_ASSERT(detail::is_alignment(alignment));
0028     return (reinterpret_cast<std::size_t>(ptr) & (alignment - 1)) == 0;
0029 }
0030 
0031 } /* alignment */
0032 } /* boost */
0033 
0034 #endif