post() with const ref.
Added "safety" of passing move-able reference is an illusion since no use_count()==1 test is done. Instead extra (shallow) copies were made for each subscriber. Instead. Pass const reference, redefine MonitorControlOp::post() to transfer ownership, and make only a single copy in SharedPV::post().
This commit is contained in:
+1
-1
@@ -74,7 +74,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
// (optional) update the SharedPV cache and send
|
||||
// a update to any subscribers
|
||||
pv.post(std::move(top));
|
||||
pv.post(top);
|
||||
|
||||
// Required. Inform client that PUT operation is complete.
|
||||
op->reply();
|
||||
|
||||
Reference in New Issue
Block a user