]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
1 | /* |
2 | Copyright 2015 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 | #ifndef BOOST_ALIGN_ALIGN_UP_HPP | |
9 | #define BOOST_ALIGN_ALIGN_UP_HPP | |
10 | ||
11 | #include <boost/align/detail/align_up.hpp> | |
92f5a8d4 | 12 | #include <boost/align/detail/not_pointer.hpp> |
b32b8144 FG |
13 | |
14 | namespace boost { | |
15 | namespace alignment { | |
16 | ||
92f5a8d4 TL |
17 | template<class T> |
18 | BOOST_CONSTEXPR inline typename detail::not_pointer<T, T>::type | |
19 | align_up(T value, std::size_t alignment) BOOST_NOEXCEPT | |
b32b8144 | 20 | { |
92f5a8d4 | 21 | return T((value + (T(alignment) - 1)) & ~T(alignment - 1)); |
b32b8144 FG |
22 | } |
23 | ||
24 | } /* alignment */ | |
25 | } /* boost */ | |
26 | ||
27 | #endif |