Skip to content

Commit 4df0fbf

Browse files
authored
Create 003_rtti_std_is_trivial.cpp
1 parent 60b7b94 commit 4df0fbf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

cpp_11/003_rtti_std_is_trivial.cpp

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

0 commit comments

Comments
 (0)