ostringstream is the perfect C++ replacement for sprintf, except for trying to debug its contents in Visual Studio.
Add this to Microsoft Visual Studio 12.0\Common7\Packages\Debugger\Visualizers\stl.natvis:
<Type Name="std::basic_ostringstream<char,*>">
<DisplayString>{_Mystrbuf->_Gfirst},s</DisplayString>
<StringView>_Mystrbuf->_Gfirst,s</StringView>
<Expand>
<Item Name="[state]">_Mystate</Item>
<ExpandedItem>_Mystrbuf->_Gfirst</ExpandedItem>
</Expand>
</Type>
No comments:
Post a Comment