Re: Question about STL containers in multithreaded environment
- From: "Vladimir Frolov" <voidbent@xxxxxxxxx>
- Date: 9 Mar 2006 03:40:29 -0800
gioparl wrote:
I didn't know that...
so the good way is:
const iteraror=map.find(key);
if(iterator!=map.end())
return iterator->second;
or also I have to make a const alias to map also ??
All STL containers is allowed (but it is not obligatory) to have
reference counted implementation to optimize copying and swaping
operations (especially for std::string-s). So one cannot guarantee that
if you invoke non-const method you container will not be changed. You
has to make const alias in your case also.
.
- References:
- Question about STL containers in multithreaded environment
- From: nicolas . michel . lava
- Re: Question about STL containers in multithreaded environment
- From: dhruv
- Re: Question about STL containers in multithreaded environment
- From: Alan Woodland
- Re: Question about STL containers in multithreaded environment
- From: g
- Re: Question about STL containers in multithreaded environment
- From: Vladimir Frolov
- Re: Question about STL containers in multithreaded environment
- From: gioparl
- Question about STL containers in multithreaded environment
- Prev by Date: Re: thread migraiton to other systems
- Next by Date: Re: thread migraiton to other systems
- Previous by thread: Re: Question about STL containers in multithreaded environment
- Next by thread: Re: Question about STL containers in multithreaded environment
- Index(es):
Relevant Pages
|
Loading