Boost logo

Boost :

From: Ulrich Eckhardt (doomster_at_[hidden])
Date: 2007-05-23 00:46:49


On Tuesday 22 May 2007 21:19:11 Jeffrey Faust wrote:
> My only complaint about boost::optional is that it is very difficult to
> see values in the debugger. I brought this up in a discussion at
> BoostCon, and Jeff Garland suggested I submit a patch.
>
> Well, I have a patch. The change introduces a new private T* m_value and
> protected method update_debug() which sets this variable. The variable is
> only visible when building debug, and the method is empty in non-debug.
> From there, I simply call update_debug() in each public method that
> changes the storage.
>
> The final result is that debuggers can see the variable data by looking at
> opt.m_value. When not set, the value is null.

I'm not against making things debugger-friendly, but not at the cost of
performance. Also, I find the objections about having different layouts
valid.

Other than that, I know that at least GDB and MS debugger can be scripted and
that it might be a different approach that is non-intrusive.

Uli


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk