/* (c) 2014-2015 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. http://boost.org/LICENSE_1_0.txt */ #include #include #include #include template struct A { }; template void test(T* p, A) { BOOST_TEST(boost::alignment::is_aligned(p, N)); BOOST_TEST(!boost::alignment::is_aligned((char*)p + 1, N)); } template void test(T* p, A<1>) { BOOST_TEST(boost::alignment::is_aligned(p, 1)); } template void test() { T o; test(&o, A::value>()); } class X; int main() { test(); test(); test(); #if !defined(BOOST_NO_CXX11_CHAR16_T) test(); #endif #if !defined(BOOST_NO_CXX11_CHAR32_T) test(); #endif test(); test(); test(); #if !defined(BOOST_NO_LONG_LONG) && !defined(_MSC_VER) test(); #endif test(); #if !defined(_MSC_VER) test(); test(); #endif test(); test(); test(); test(); test(); #if !defined(_MSC_VER) test(); test(); #endif return boost::report_errors(); }