Boost logo

Boost Users :

Subject: Re: [Boost-users] How to terminate a specific thread among other threads
From: Igor R (boost.lists_at_[hidden])
Date: 2012-04-15 15:03:06


> Thank you very much sir , but how could possibly those threads modify the
> itemes in a vector using [] operator!! ?
> in my sample i just had them read a value using [] operator ! there is no
> assignment !

You call a non-const overload of operator[], so theoretically it can
change the vector (if it's not prohibited by the standard). Actually,
even if it were the const overload, it could change some mutable
internal object state (again, it's worth reading what the standard
says about it), so I guess you can't treat the operator[] as a pure
"reader". Anyway, in your case it's not so important, as you use the
regular mutex, not shared_mutex.


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