You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the C++ standard, all Associative Containers: The insert and emplace members shall not affect the validity of iterators and references to the container [26.2.6/9].
However I found that after insertion of of a list of element, some iterator values are invalidated.
Please find bellow code snippet to test this feature:
While this container has an interface similar to C++ standard associative container, this container is not a part of the C++ standard library, hence those requirements do not apply.
It is unfortunate for the C++ standard that those requirements do not allow for fast associative containers with open addressing.
According to the C++ standard, all Associative Containers: The insert and emplace members shall not affect the validity of iterators and references to the container [26.2.6/9].
However I found that after insertion of of a list of element, some iterator values are invalidated.
Please find bellow code snippet to test this feature:
namespace xxx {
typedef std::string key_t;
typedef std::string value_t;
}
...
std::vector keys(MAX_SIZE);
generatKeys(keys);
...
for (auto& key : keys) {
std::pair < xxx::map_t::iterator, bool> ret = dict.insert(xxx::map_t::value_type(key, keys[rand() % MAX_SIZE]));
The text was updated successfully, but these errors were encountered: