Apologies if this isn't the right place to ask this. I'm new to the
lists here. Also apologies if I'm just forgetting something obvious.
I'm using Obj-C++ with whatever specific compiler is running under
XCode on Tiger 10.4.3.
I'm passing a function object as predicate to stl's find_if. The
function object's constructor is being called once as expected upon
entering find_if. On return, the destructor is being invoked *twice*:
seemingly once when losing scope in find_if and once after find_if
returns ... it's hard to be precise because XCode/gdb is not
respecting breakpoints inside my function object's xtors. But that's a
different issue (though maybe related somehow?).
This is, needless to say, detrimental to my program's stability. Any
ideas about this would be greatly appreciated. I can work around it,
of course, but as far as I know, this shouldn't be happening. But ...
surely I'm just forgetting something elementary?
The relevant code's pretty short, so I'll paste it in:
// --------------------- function object interface, an inner class to "VizNode"
class hasGUID : public std::unary_function< VizNode*, bool >
hasGUID( NSString* iGUID );
result_type operator() ( argument_type n );