Anonymus Anonymus - 1 year ago 82
C++ Question

Deleting Value From Multi Dimensional Map?

I am currently making my own voxel engine in c++, however I seem to have come across a problem.

I am using a chunk based system and storing it in a 3-dimensional map, the variable definition looks like this:

map<uint64_t,map<uint64_t,map<uint64_t,Chunk*>>> Chunks;

However, I can't really find a proper way to delete any value from the map, I have tried using the
function but with no succes, is there any good way to do this that I am unaware of?

This was the
function I was trying:


Thanks in advance!

Answer Source

The map is a key-value type, so you cannot try access as array:

Try to remove the first element by example:



Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download