I'm using the C++ runtime but I guess the same apply for the C runtime as well. In my case I am building the rendering engine in a way that requires fast access to the attachments. Right now the only way to identify an attachment is using its name. So right now all attachments are in:
std::unordered_map<String, Attachment*>
I think will be nice to have some runtime generated int IDs and some method such as:
int Attachment::getID() const;
In that way the map will work faster. Also there will be no need to implement custom String
hash function because right now String
has no hash function so it is unable to add in unordered_map
out of the box.