• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>
12 #include <boost/align/detail/not_pointer.hpp>
13 
14 namespace boost {
15 namespace alignment {
16 
17 template<class T>
18 BOOST_CONSTEXPR inline typename detail::not_pointer<T, T>::type
align_up(T value,std::size_t alignment)19 align_up(T value, std::size_t alignment) BOOST_NOEXCEPT
20 {
21     return T((value + (T(alignment) - 1)) & ~T(alignment - 1));
22 }
23 
24 } /* alignment */
25 } /* boost */
26 
27 #endif
28