//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // is_standard_layout #include #include "test_macros.h" template void test_is_standard_layout() { static_assert( std::is_standard_layout::value, ""); static_assert( std::is_standard_layout::value, ""); static_assert( std::is_standard_layout::value, ""); static_assert( std::is_standard_layout::value, ""); #if TEST_STD_VER > 14 static_assert( std::is_standard_layout_v, ""); static_assert( std::is_standard_layout_v, ""); static_assert( std::is_standard_layout_v, ""); static_assert( std::is_standard_layout_v, ""); #endif } template void test_is_not_standard_layout() { static_assert(!std::is_standard_layout::value, ""); static_assert(!std::is_standard_layout::value, ""); static_assert(!std::is_standard_layout::value, ""); static_assert(!std::is_standard_layout::value, ""); #if TEST_STD_VER > 14 static_assert(!std::is_standard_layout_v, ""); static_assert(!std::is_standard_layout_v, ""); static_assert(!std::is_standard_layout_v, ""); static_assert(!std::is_standard_layout_v, ""); #endif } template struct pair { T1 first; T2 second; }; int main() { test_is_standard_layout (); test_is_standard_layout (); test_is_standard_layout > (); test_is_not_standard_layout (); }