问题 I have this piece of code: auto it = my_map.lower_bound(my_key); The following assert gives me error: static_assert(std::is_same<decltype(it), std::map<K, V>::const_iterator>::value, "Error"); And the following one, is ok: static_assert(std::is_same<decltype(it), std::map<K, V>::iterator>::value, "Error"); Then, the compiler is not giving me a const_iterator . Ok. But here: my_map.insert_or_assign(it, my_key, some_val); even with iterator (not const_iterator ), the function is working. But,