Boost logo

Boost Users :

From: Alisdair Meredith (yg-boost-users_at_[hidden])
Date: 2003-03-28 15:55:40


Douglas Gregor wrote:

> Dereferencing an iterator into that list should give you a reference to a
> boost::function2 object. If BCB6 is calling that function object, it has a
> Very Big Problem.

I'll look into this further next week, and see if I can produce an
interesting test case. As you point out, what I am trying to do here is
not valid anyway!

> Granted, you wouldn't be able to search the list for a particular function
> object anyway, because boost::function objects can't be compared.

Yup, I spotted I had mis-read the docs right after posting. My bad.

> I suggest
> either:
> (1) associate some additional data with each callback that is unique to that
> callback (e.g., an integer or string value) and use std::map<Key,
> boost::function2<...> >, or

Yes, this is what I have done <g>

> (3) use Signals to do #2 for you

I tried looking at signals a while back, but hit problems with either my
understanding or the compiler.
However, solving this sure makes me feel like I'm re-inventing the
wheel! It's high on my list of things to look into after the ACCU.

-- 
AlisdairM

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