2 Copyright 2015 Glen Joseph Fernandes
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_ALIGN_DETAIL_ALIGN_DOWN_HPP
9 #define BOOST_ALIGN_DETAIL_ALIGN_DOWN_HPP
11 #include <boost/align/detail/is_alignment.hpp>
12 #include <boost/assert.hpp>
18 align_down(void* ptr, std::size_t alignment) BOOST_NOEXCEPT
20 BOOST_ASSERT(detail::is_alignment(alignment));
21 return reinterpret_cast<void*>(~(alignment - 1) &
22 reinterpret_cast<std::size_t>(ptr));