I am trying to do:
std::find(images_map.begin(), images_map.end(), current_rgb));
where:
QRgb current_rgb;
QMap<QRgb, MI*> images_map;
but I get:
error: no matching function for call to 'find(QMap<unsigned int, MI*>::iterator, QMap<unsigned int, MI*>::iterator, QRgb&)
The reason is because find expects the value_type of the container to be the same as the searchee type passed in to find. You passed in just the key, not the key and value.
Instead, use the find method on the container itself (which also has the benefit of being logarithmic instead of linear time complexity).
Use the QMap::find() method instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With