9 Jun
2008
9 Jun
'08
4:59 p.m.
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