Minimal Example code:
int main(){
std::unordered_map<int,int> data = {
{1,2},
{2,3},
{3,4}
};
data[4] = 5;
}
I’m breaking on the last line (data[4] =5;). Here, I am attempting to access data[3] but am met with:
(gdb) p data[3] Attempt to take address of value not located in memory.
I’d like to set a watchpoint for one of the entries in an std::unordered_map<int,int>, because a bug in my program is causing one of the entries to dissapear.
My ultimate goal is to detect when a specific key is removed from the unorederd_map. Is this possible?