| 2 | |
| 3 | template<typename T, bool array> |
| 4 | class Alloc |
| 5 | { |
| 6 | T* data; |
| 7 | |
| 8 | public: |
| 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 | |
| 29 | int main() |
| 30 | { |
nothing calls this directly
no outgoing calls
no test coverage detected