Skip to main content

Command Palette

Search for a command to run...

ostringstream is the perfect C++ replacement for sprintf, except...

Updated
1 min read

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>

More from this blog

Roderick's Debug Diary

58 posts

https://mastodon.social/@rvkennedy