MCPcopy Create free account
hub / github.com/0voice/cpp_new_features / main

Function main

cpp_11/002_grammar_POD.cpp:20–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18};
19
20int 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected