MCPcopy Create free account
hub / github.com/EricPengShuai/Interview / B

Class B

base_code/virtual_base.cpp:22–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20};
21
22class B : virtual public A
23{
24public:
25 void show() {
26 cout << "B::show()" << endl;
27 }
28
29 void* operator new(size_t size) {
30 void *p = malloc(size);
31 cout << "operator new p: " << p << endl;
32 return p;
33 }
34
35 void operator delete(void *ptr) {
36 cout << "B::opeartor delete p: " << ptr << endl;
37 free(ptr);
38 }
39private:
40 int mb;
41};
42
43
44int main()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected