Can't see boost::optional contents when debugging with Visual Studio

邮差的信 提交于 2019-12-10 03:02:21

问题


If I try to look at the variable directly, I see a ? sign. If I create a watch calling the is_initialized function, I get the following error:

CXX0033: Error: error in OMF type information

I didn't find much info about this error related to Boost using Google.

Anybody else experienced this? It's a hassle using OutputDebugString everywhere and rebuilding...

EDIT: Using Visual Studio 2010 SP1 with all hotfixes in Windows XP SP3 idem, and Boost 1.49.0

UPDATE: This issue comes and goes, it doesn't happen consistently; Debugger Visualizers are a great solution, I've adopted them as my brand new tool


回答1:


You can use DebuggerVisualizers.




回答2:


Try this: for a variable boost::optional<Category> category, create a watch on: category.get()




回答3:


Use DebuggerVisualizers to make this transition:

Before

After

P.S. I tried to add these images to clarify the accepted answer but my edit was rejected.



来源:https://stackoverflow.com/questions/11300631/cant-see-boostoptional-contents-when-debugging-with-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!