Transfer ownership from a unique_ptr to a ThreadLocalPtr
authorChad Parry <cparry@fb.com>
Thu, 12 May 2016 21:47:19 +0000 (14:47 -0700)
committerFacebook Github Bot 8 <facebook-github-bot-8-bot@fb.com>
Thu, 12 May 2016 21:53:33 +0000 (14:53 -0700)
commit0a0e47de0d3ca55d0340b3b0e1211a5aa184a04c
tree11ae13e2beafe22ea2fcd1dcc9fd4940286f7542
parent34986bb445bd32bdcf729ae1820971c06a9c5cd2
Transfer ownership from a unique_ptr to a ThreadLocalPtr

Summary:
This `ThreadLocalPtr::reset` overload will accept a `unique_ptr`. It's actually not totally exception safe, simply because `ElementWrapper::set` is not exception safe. The best I can say is that my additional code is exactly as safe as the underlying implemenation.

liketolivedangerously

Reviewed By: ericniebler

Differential Revision: D3271563

fbshipit-source-id: 774bcf31924b1ed4e29a6cb1c0a36ad710ab6034
folly/ThreadLocal.h
folly/test/ThreadLocalTest.cpp