]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/align/align_up.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / align / align_up.hpp
index 6401ea848a63f19d229d5b2e719ca121dfc0bc4f..84e1a3cb58752861241ac5bcee1737533ef2bd13 100644 (file)
@@ -9,14 +9,16 @@ Distributed under the Boost Software License, Version 1.0.
 #define BOOST_ALIGN_ALIGN_UP_HPP
 
 #include <boost/align/detail/align_up.hpp>
+#include <boost/align/detail/not_pointer.hpp>
 
 namespace boost {
 namespace alignment {
 
-BOOST_CONSTEXPR inline std::size_t
-align_up(std::size_t value, std::size_t alignment) BOOST_NOEXCEPT
+template<class T>
+BOOST_CONSTEXPR inline typename detail::not_pointer<T, T>::type
+align_up(T value, std::size_t alignment) BOOST_NOEXCEPT
 {
-    return (value + alignment - 1) & ~(alignment - 1);
+    return T((value + (T(alignment) - 1)) & ~T(alignment - 1));
 }
 
 } /* alignment */