In C #, if I define a structure, I can also override ToString (). Then, when I debug and add a clock or hover over an instance of the structure, the tooltip will be computed by ToString (), not the type of the structure name.
Can I do this in C ++ and / or C ++ / CLI? That is, can I define the method as part of the structure (or do something else), which will cause watch-value / tooltip to display a string of my choice? The default string rendering in Visual Studio for C / C ++ is a list of all the structure field values (or as many as can be clamped in a small box).
My types are all C-style structures. (In fact, it was written in C before I converted the files to .cpp and fixed some type problems so that I could run it in the CLI.) Here's an example struct:
struct other_dollars_node { struct other_dollars_node *next_other_dollars; override *overrides; long other_dollars_id; tm effective_date; double amount; }
I have very little experience with C ++ / CLI - most of my experience has been with native C / C ++ and C #. I am using Visual Studio 2013.
Update: since almost all existing code uses native C syntax, and I would prefer a solution that works without the need for refactoring, the CLI aspect may be less important.
source share