作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我应该在 QMap::insertMulti 和 QMultiMap 之间使用什么来处理:
2 -> abc
2 -> 定义
3 -> ghi
3 -> jkl
输入 2 个解决方案有什么区别?
最佳答案
阅读 Container Classes :
QMap<Key, T>
This provides a dictionary (associative array) that maps keys of type Key to values of type T. Normally each key is associated with a single value. QMap stores its data in Key order; if order doesn't matter QHash is a faster alternative.
QMultiMap<Key, T>
This is a convenience subclass of QMap that provides a nice interface for multi-valued maps, i.e. maps where one key can be associated with multiple values.
看起来两者都能胜任。在本文档中还有 Algorithmic Complexity您可以在其中看到两个类具有相同复杂性的部分。
我会选择 QMultiMap
只是为了更好地记录我将使用同一个键保存多个值这一事实。
关于c++ - QMap::insertMulti 还是 QMultiMap?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4624791/
我应该在 QMap::insertMulti 和 QMultiMap 之间使用什么来处理: 2 -> abc 2 -> 定义 3 -> ghi 3 -> jkl 输入 2 个解决方案有什么区别? 最佳
我正在使用 ThingEngineer/PHP-MySQLi-Database-Class,并且尝试在使用 OnDuplicate 时执行多次插入。目标是在“sku”尚不存在时插入新的产品记录。如果“
我是一名优秀的程序员,十分优秀!