|
Boost Users : |
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-06-09 12:59:48
AMDG
Ovanes Markarian wrote:
>
>
> // assignment operator
> CircularBuffer& operator= (const CircularBuffer& other)
> {
> CircularBuffer temp(other);
>
> why do you need this temp, if it is not used further?
>
>
> WriteLock w_lock(rw_mutex);
>
> using std::swap;
> swap(m_capacity, other.m_capacity);
> swap(m_buffer, other.m_buffer);
>
Whoops.
swap(m_capacity, temp.m_capacity);
swap(m_buffer, temp.m_buffer);
In Christ,
Steven Watanabe
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