Boost logo

Boost Users :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-09-16 13:30:55


Hi Chris,

On Mon, 16 Sep 2002, Chris Russell wrote:
cdr> p.156 of the BGL book: "... visitors are passed by value..."
cdr>
cdr> I was attempting to set a breakpoint in a visitor event handler (that
cdr> I know is executing) but the breakpoint is seemingly ignored by my
cdr> debugger. This is because the visitor I construct and subsequently
cdr> pass to the algorithm is not the object that is actually dispatched
cdr> by the algorithm. Correct? Using the Intel compiler under MS

Yes, that is correct.

cdr> DevStudio 6 on Windows, I inserted a ::DebugBreak() (asm int 3) into
cdr> the visitor and *do* hit that but only have assembly language and not
cdr> source to step through at that point.
cdr>
cdr> Why are visitors passed to algorithms by value? Any suggestions for

Well, visitors are like functors, and the STL passes functors by-value.
There are some non-trivial reasons for that decision that I don't have
time to go into now.

cdr> debugging visitor code at the C++ source level and not in assembly?
cdr>

Sorry, I don't have a lot of experience with that debugger.

Regards,
Jeremy

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net