You can’t easily tell just by looking at the memory location if the object is still allocated or not. There might be some black magic tricks to do that, but a much cleaner way would be to build a call-back mechanism into the object’s destructor.
More Related Contents:
- drawbacks of using new/delete in ANSI C [closed]
- How to allocate memory dynamically for class using new in C++?
- Why do I get “unresolved external symbol” errors when using templates? [duplicate]
- What does it mean to “ODR-use” something?
- Why use std::bind over lambdas in C++14?
- Determine the size of a C++ array programmatically?
- constexpr if and static_assert
- ‘colon’ and ‘auto’ in for loop c++? need some help understanding the syntax
- Difference Between *(Pointer + Index) and Pointer[]
- What is the purpose of allocating a specific amount of memory for arrays in C++?
- Why does gcc compiler output pow(10,2) as 99 not 100? [duplicate]
- Why does int*[] decay into int** but not int[][]?
- Need for predictable random generator
- Most optimized way of concatenation in strings
- std::ignore with structured bindings?
- At what point is it worth using a database?
- Does case-switch work like this?
- Create a reverse LinkedList in C++ from a given LinkedList
- mixing templates with polymorphism
- Dereferencing deleted pointers always result in an Access Violation?
- How to compare two vectors for equality element by element in C++?
- Generate include file name in a macro
- How do I build boost with new Visual Studio 2013 preview?
- Is there a clean way to prevent windows.h from creating a near & far macro?
- The proper way of forcing a 32-bit compile using CMake
- Linking C++ code with ‘gcc’ (without g++)
- When will ofstream::open fail?
- What standard clause mandates this lvalue-to-rvalue conversion?
- How is this a most vexing parse?
- What does the vertical bar ( | ) mean in C++?