Boost logo

Boost Users :

Subject: [Boost-users] Regarding thread_specific_ptr's non-moveability
From: Daniel Hofmann (daniel_at_[hidden])
Date: 2015-12-15 10:19:46


thread_specific_ptr is currently (Boost 1.59) not moveable, since it
defines a user-declared destructor and in addition (privately)
user-declares the copy special member functions.

Is this decision by design, or simply not yet updated to move semantics?

>From what I can tell, a move should be possible along the lines of:

  auto* p = other.release(); // without invoking other's cleanup fn
  reset(p); // potentially differente cleanup fn associated

The only problematic situation I can think of is a scenario with two
semantically different custom cleanup function where a move eventually
triggers only the second one. But this is behavior is consistent with
move semantic.

Cheers,
Daniel J H

References:

>
http://www.boost.org/doc/libs/1_59_0/doc/html/thread/thread_local_storage.html

> http://www.boost.org/doc/libs/1_59_0/boost/thread/tss.hpp


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