Skip to content

Commit 241a824

Browse files
authored
Create 003_rtti_std_is_trivially_copyable.cpp
1 parent 4df0fbf commit 241a824

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <iostream>
2+
#include <type_traits>
3+
4+
struct A {
5+
int m;
6+
};
7+
8+
struct B {
9+
B(const B&) {}
10+
};
11+
12+
struct C {
13+
virtual void foo();
14+
};
15+
16+
int main()
17+
{
18+
std::cout << std::boolalpha;
19+
std::cout << std::is_trivially_copyable<A>::value << '\n';
20+
std::cout << std::is_trivially_copyable<B>::value << '\n';
21+
std::cout << std::is_trivially_copyable<C>::value << '\n';
22+
}

0 commit comments

Comments
 (0)