#std::unordered_map operator[] at element that didn't exist : is it garbage?

12 messages · Page 1 of 1 (latest)

grim prismBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

wintry fern
#

Unordered maps will 0 initialize new primative values from []

#

Basically you can imagine primatives having a default constructor that has garbage and an explicit default constructor that initializes to 0;

tough rockBOT
#
Critical error:

You are sending requests too fast!

wintry fern
#

Nooo I meant to copy that not delete :(

#

;compile

int x;
int y{};
printf("%d %d\n", x, y);
tough rockBOT
#
Program Output
1651076199 0
wintry fern
#

There we go

tough rockBOT
#
Program Output
1651076199 0
grim prismBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity

wintry fern