| 18 | }; |
| 19 | |
| 20 | int main() { |
| 21 | if (std::is_pod<A>::value) { |
| 22 | std::cout << "before" << std::endl; |
| 23 | A a; |
| 24 | a.x = 8; |
| 25 | a.y = 10.5; |
| 26 | std::cout << a.x << std::endl; |
| 27 | std::cout << a.y << std::endl; |
| 28 | |
| 29 | size_t size = sizeof(a); |
| 30 | char *p = new char[size]; |
| 31 | memcpy(p, &a, size); |
| 32 | A *pA = (A*)p; |
| 33 | |
| 34 | std::cout << "after" << std::endl; |
| 35 | std::cout << pA->x << std::endl; |
| 36 | std::cout << pA->y << std::endl; |
| 37 | |
| 38 | delete p; |
| 39 | } |
| 40 | return 0; |
| 41 | } |
nothing calls this directly
no outgoing calls
no test coverage detected