]>
git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
common/bl: introduce rvalue taking claim_append().
The motivation is to stop prohibiting callers from
directly passing temporaries. It was not infrequent
to see constructs like:
```cpp
{
// ...
auto tmp = produce_bl();
other_bl.claim_append(tmp);
}
```
They were necessary because `claim_append(bufferlist&)`
requires lvalue reference to which an rvalue can't bind.
This patch fixes the problem by introducing `&&`-taking
variant of `claim_append()`. In the future it could
actually supersede the original one.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>