94 printf(
"\n=== Checking component: %s ===\n", type_name<T>());
97 printf(
" Size: %zu bytes, Alignment: %zu\n",
sizeof(T),
alignof(T));
101 printf(
" is_trivial: %s\n", std::is_trivial_v<T> ?
"yes" :
"no");
102 printf(
" is_trivially_copyable: %s\n", std::is_trivially_copyable_v<T> ?
"yes" :
"no");
103 printf(
" is_trivially_destructible: %s\n", std::is_trivially_destructible_v<T> ?
"yes" :
"no");
106 printf(
" is_default_constructible: %s\n", std::is_default_constructible_v<T> ?
"yes" :
"no");
107 printf(
" is_nothrow_default_constructible: %s\n",
108 std::is_nothrow_default_constructible_v<T> ?
"yes" :
"no");
109 printf(
" is_nothrow_copy_constructible: %s\n", std::is_nothrow_copy_constructible_v<T> ?
"yes" :
"no");
110 printf(
" is_nothrow_move_constructible: %s\n", std::is_nothrow_move_constructible_v<T> ?
"yes" :
"no");
111 printf(
" is_nothrow_destructible: %s\n", std::is_nothrow_destructible_v<T> ?
"yes" :
"no");
114 printf(
" is_copy_assignable: %s\n", std::is_copy_assignable_v<T> ?
"yes" :
"no");
115 printf(
" is_move_assignable: %s\n", std::is_move_assignable_v<T> ?
"yes" :
"no");
116 printf(
" is_nothrow_copy_assignable: %s\n", std::is_nothrow_copy_assignable_v<T> ?
"yes" :
"no");
117 printf(
" is_nothrow_move_assignable: %s\n", std::is_nothrow_move_assignable_v<T> ?
"yes" :
"no");
120 printf(
" is_empty: %s (can use empty base optimization)\n", std::is_empty_v<T> ?
"yes" :
"no");
121 printf(
" is_standard_layout: %s (memcpy safe)\n", std::is_standard_layout_v<T> ?
"yes" :
"no");
122 printf(
" is_pod (deprecated): %s\n", std::is_pod_v<T> ?
"yes" :
"no");
123 printf(
" has_unique_object_representations: %s (hashing)\n",
124 std::has_unique_object_representations_v<T> ?
"yes" :
"no");
127 printf(
" is_final: %s\n", std::is_final_v<T> ?
"yes" :
"no");
130 constexpr bool can_memcpy = std::is_trivially_copyable_v<T> && std::is_trivially_destructible_v<T>;
131 printf(
" Can use memcpy for bulk operations: %s\n", can_memcpy ?
"yes" :
"no");
135 constexpr bool optimal_for_ecs = std::is_trivially_copyable_v<T> && std::is_trivially_destructible_v<T>
136 && std::is_nothrow_move_constructible_v<T>
137 && std::is_nothrow_move_assignable_v<T>
138 && std::is_default_constructible_v<T>;
139 printf(
" Optimal for ECS: %s\n", optimal_for_ecs ?
"YES" :
"NO");
141 if (!optimal_for_ecs)
143 printf(
" WARNING: This component may have performance overhead!\n");