/* Copyright 2014-2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #include #include #include #include template struct A { }; template void test(char* p, A) { BOOST_TEST(boost::alignment::is_aligned(p, N)); BOOST_TEST(!boost::alignment::is_aligned(p + 1, N)); } void test(char* p, A<1>) { BOOST_TEST(boost::alignment::is_aligned(p, 1)); } template void test() { T o; test(reinterpret_cast(&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(BOOST_MSVC) test(); test(); #endif test(); test(); test(); test(); test(); #if !defined(_MSC_VER) || !defined(__clang__) #if !defined(BOOST_MSVC) test(); test(); #endif #endif return boost::report_errors(); }