]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/align/is_aligned.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / align / is_aligned.hpp
1 /*
2 Copyright 2014 Glen Joseph Fernandes
3 (glenjofe@gmail.com)
4
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
7
8 */
9 #ifndef BOOST_ALIGN_IS_ALIGNED_HPP
10 #define BOOST_ALIGN_IS_ALIGNED_HPP
11
12 #include <boost/align/detail/is_aligned.hpp>
13 #include <boost/align/detail/not_pointer.hpp>
14
15 namespace boost {
16 namespace alignment {
17
18 template<class T>
19 BOOST_CONSTEXPR inline typename detail::not_pointer<T, bool>::type
20 is_aligned(T value, std::size_t alignment) BOOST_NOEXCEPT
21 {
22 return (value & (T(alignment) - 1)) == 0;
23 }
24
25 } /* alignment */
26 } /* boost */
27
28 #endif