2
0
mirror of https://github.com/boostorg/align.git synced 2026-01-29 19:12:08 +00:00

Change interface of align_up and align_down

This commit is contained in:
Glen Fernandes
2015-12-16 07:28:09 -05:00
parent e0e5640d45
commit 2fe6991bad
12 changed files with 132 additions and 38 deletions

View File

@@ -15,17 +15,17 @@ void test()
{
char s[Alignment << 1];
char* b = s;
while (!boost::alignment::is_aligned(Alignment, b)) {
while (!boost::alignment::is_aligned(b, Alignment)) {
b++;
}
std::size_t n = Alignment;
{
void* p = &b[n];
BOOST_TEST(boost::alignment::is_aligned(n, p));
BOOST_TEST(boost::alignment::is_aligned(p, n));
}
if (n > 1) {
void* p = &b[1];
BOOST_TEST(!boost::alignment::is_aligned(n, p));
BOOST_TEST(!boost::alignment::is_aligned(p, n));
}
}