【问题标题】:How to see the content stored in std::deque in Visual studio 2010 (debug mode)如何在 Visual Studio 2010 中查看存储在 std::deque 中的内容(调试模式)
【发布时间】:2013-07-26 16:15:16
【问题描述】:

对于std::vector,可以在调试模式下Visual Studio 2010的watch window中使用以下语句查看内容

(v._Myfirst)[startIndex], count  

其中 v 是向量变量,count 是要列出的值的数量。

像 std::vector 一样:有什么方法可以在 Visual Studio 2010(调试模式)中查看存储在 std::deque 中的内容吗?

谢谢,

【问题讨论】:

    标签: c++ visual-studio-2010 debugging stl


    【解决方案1】:

    以下是我用来解决此问题的设置。此设置不仅解决了 std::deque 容器中不显示内容的问题,它还开始在调试模式下显示其他 stl 容器中的内容以及 [Vector, Map, Set etc]。

    [我仅针对与 Microsoft Visual Studio 2010 Service pack 1 一起安装的 Visual Studio 2010 Professional 版本测试了此设置]

    第 1 步: 卸载 Microsoft Visual Studio 2010 Service Pack 1 - 对于我的项目工作,我真的不需要 Service Pack 1,因此卸载 Service Pack 1 不会对我的情况造成任何问题。

    第 2 步: 重新启动系统。

    第 3 步:如果您没有收到 错误“链接:致命错误 LNK1123:转换为 COFF 时失败:文件无效或损坏”,则不需要此步骤。否则浏览

    Project Property -> Linker (General) ->Enable Incremental Linking改为No (/INCREMENTAL:NO)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多