MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / Alloc

Class Alloc

tests/CXXDestructorTest.cpp:4–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
3template<typename T, bool array>
4class Alloc
5{
6 T* data;
7
8public:
9 Alloc() {
10 if( array ) {
11 data = new T[10];
12 data = new T[10]{1,2,3};
13 } else {
14 data = new T;
15 data = new T(2);
16 data = new T{2};
17 }
18 }
19
20 ~Alloc() {
21 if( array ) {
22 delete[] data;
23 } else {
24 delete data;
25 }
26 }
27};
28
29int main()
30{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected