1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // type_traits 11 12 // is_standard_layout 13 14 #include <type_traits> 15 16 template <class T1, class T2> 17 struct pair 18 { 19 T1 first; 20 T2 second; 21 }; 22 23 int main() 24 { 25 static_assert( std::is_standard_layout<int>::value, ""); 26 static_assert( std::is_standard_layout<int[3]>::value, ""); 27 static_assert(!std::is_standard_layout<int&>::value, ""); 28 static_assert(!std::is_standard_layout<volatile int&>::value, ""); 29 static_assert(( std::is_standard_layout<pair<int, double> >::value), ""); 30 } 31