#include "other.h" #include #include /* Expected output: A: 9 allocations B0: 9 allocations B1: 17 allocations WARNING: 3 allocations were not deallocated In total 25 allocations At most 4 allocations at the same time */ int main() { test_function(); double* ptr1 { new double(3.14) }; std::cout << "A: " << total_allocations << " allocations" << std::endl; for (std::size_t i { 0 }; i < 2; ++i) { std::cout << "B" << i << ": " << total_allocations << " allocations" << std::endl; test_function(); delete ptr1; ptr1 = nullptr; } }