我正在尝试检查 a 的内容std::multimap
and std::multiset
in the 局部变量和表达式的窗口Qt创建者.
我得到的不是值列表,而是显示的实现细节。
奇怪的是,std::map
and std::set
对应的显示良好:
#include <iostream>
#include <map>
#include <set>
#include <string>
int main()
{
std::multimap<int, std::string> multimap;
multimap.insert(std::make_pair(1, "one"));
multimap.insert(std::make_pair(2, "two"));
multimap.insert(std::make_pair(3, "three"));
std::multiset<int> multiset = {1,2,3};
std::map<int, std::string> map;
map.insert(std::make_pair(1, "one"));
map.insert(std::make_pair(2, "two"));
map.insert(std::make_pair(3, "three"));
std::set<int> set = {1,2,3};
return 0;
}
我在用:
Qt Creator 3.0.0
gcc 4.8
GDB 7.6.1
Qt 5.2.0
Ubuntu 13.10
支持此功能吗?
您可以为 gdb 安装漂亮的打印机:
- See https://sourceware.org/gdb/wiki/STLSupport https://sourceware.org/gdb/wiki/STLSupport
- 也可以看看http://nikosams.blogspot.de/2009/10/gdb-qt-pretty-printers.html http://nikosams.blogspot.de/2009/10/gdb-qt-pretty-printers.html
- And https://github.com/ruediger/Boost-Pretty-Printer/wiki https://github.com/ruediger/Boost-Pretty-Printer/wiki
确保您至少获得版本 6
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)