]> git.proxmox.com Git - ceph.git/blame - 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
CommitLineData
b32b8144
FG
1/*
2Copyright 2015 Glen Joseph Fernandes
3(glenjofe@gmail.com)
4
5Distributed 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
14namespace boost {
15namespace alignment {
16
92f5a8d4
TL
17template<class T>
18BOOST_CONSTEXPR inline typename detail::not_pointer<T, T>::type
19align_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