Yesterday I discovered MSVC's "Natvis" tool, which allows you to tweak the debugger to present your types in an intelligent way. I quickly set about prettifying my math library.
Here's how my 3*3 matrix class looks (uninitialized data):
Gorgeous, right? My afternoon had no regrets.
However, now we get to a slightly more complicated case:
As you can see, the numbers do not align. I've figured out a way nasty crock to get the negative numbers to align with the positive numbers, but my method has no way of approaching this (here's my basic outline):
<Type ...>
<DisplayString>...</DisplayString>
<Expand ...>
<Synthetic ...>
<DisplayString ...>...</DisplayString>
</Synthetic>
...
</Expand>
</Type>
What's happening is that the number of digits being printed varies from number to number.
Therefore my question: Can I configure Natvis to print a well-defined number of digits for debugging? Alternately, perhaps you have a clever workaround?
P.S.: I will be happy to upload the Python script that generates the ".natvis" file for y'all to play with for your own types, if I get this working.