Commit 3980dd0f authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Change Synchronized::copy copy-assignment overload

Summary:
[Folly] Change Synchronized::copy copy-assignment overload: rename to `copy_into`, and take ref v.s. ptr.

(Note: this ignores all push blocking failures!)

Reviewed By: aary

Differential Revision: D13475878

fbshipit-source-id: 4923a0cc73359853357dba60c6e4be654e92ce82
parent f7bf375c
......@@ -736,9 +736,9 @@ struct Synchronized : public SynchronizedBase<
/**
* Copies datum to a given target.
*/
void copy(T* target) const {
void copyInto(T& target) const {
ConstLockedPtr guard(this);
*target = datum_;
target = datum_;
}
/**
......
......@@ -864,7 +864,7 @@ void testConstCopy() {
std::vector<int> result;
v.copy(&result);
v.copyInto(result);
EXPECT_EQ(input, result);
result = v.copy();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment