C++: Accessing std::map keys and values

Posted by Jay on Stack Overflow See other posts from Stack Overflow or by Jay
Published on 2011-01-05T00:19:34Z Indexed on 2011/01/06 0:54 UTC
Read the original article Hit count: 198

Filed under:
|
|
|
|

How do you access an std::vector of the keys or values of an std::map?

Thanks.

Edit: I would like to access the actual elements, not just copies of their contents. essentially I want a reference, not a copy.

This is essentially what I am wanting to do:

std::map<std::string, GLuint> textures_map;

// fill map

glGenTextures( textures_map.size(), &textures_map.access_values_somehow[0] );

© Stack Overflow or respective owner

Related posts about c++

Related posts about vector