
7 Apr
2009
7 Apr
'09
8:06 p.m.
If I have (template args removed for brevity): shared_lock sh_lock(mutex); scoped_lock sc_lock(move(sh_lock), try_to_lock); // Try for exclusive if (sc_lock) { ... sh_lock = move(sc_lock); // Drop back to shared *** not available } Should that assignment operator be available? Currently I'm working around this with: sh_lock.swap(shared_lock(move(sc_lock))); [or, alternatively: sh_lock = move(shared_lock(move(sc_lock))); ]