Boost logo

Boost :

From: Rene Rivera (grafik666_at_[hidden])
Date: 2003-01-09 12:01:45


[2003-01-09] William E. Kempf wrote:

>> From: Rene Rivera <grafik666_at_[hidden]>
>> The one place I would like to have such a thing it would have to be id().
>>
>> I have one, very overused, place in my code where I have to iterate on a
>> list of objects, which have thread pointers to find the object given the
>> current thread. It would somewhat cleaner and easier to understand if I
>> could have a std::map<thread::ID,object*> instead.
>
>That doesn't necessarily speak for an ID type in addition to boost::thread.
It only
>adds another requirement that could be met by boost::thread itself. Either
an
>operator<(), knowing that the ordering is arbitrary, or follow the same
route as
>std::type_info and include a before(). Thoughts?

Having an operator<() would work, but not be as convenient as an ID. In my
simple thread.ID -> object* sample I would have to change it to thread* ->
object* and add the dereference ops accordingly. So I would still prefer the
ID, it's just cleaner and easier to understand.

-- grafik - Don't Assume Anything
-- rrivera_at_[hidden] - grafik_at_[hidden]
-- 102708583_at_icq


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