Beside int float string etc., you can put extra data to .second when using diff. types like:
std::map<unsigned long long int, glm::ivec2> voxels_corners;
std::map<unsigned long long int, glm::ivec2>::iterator it_corners;
or
struct voxel_map {
int x,i;
};
std::map<unsigned long long int, voxel_map> voxels_corners;
std::map<unsigned long long int, voxel_map>::iterator it_corners;
when
long long unsigned int index_first=some_key; // llu in this case...
int i=0;
voxels_corners.insert(std::make_pair(index_first,glm::ivec2(1,i++)));
or
long long unsigned int index_first=some_key;
int index_counter=0;
voxel_map one;
one.x=1;
one.i=index_counter++;
voxels_corners.insert(std::make_pair(index_first,one));
with right type || structure you can put anything in the .second including a index number that is incremented when doing an insert.
instead of
it_corners - _corners.begin()
or
std::distance(it_corners.begin(), it_corners)
after
it_corners = voxels_corners.find(index_first+bdif_x+x_z);
the index is simply:
int vertice_index = it_corners->second.y;
when using the glm::ivec2 type
or
int vertice_index = it_corners->second.i;
in case of the structure data type