Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/ObjectStore: add noexcept to ensure move ctor is used #8421

Merged
merged 1 commit into from Apr 4, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/os/ObjectStore.h
Expand Up @@ -438,15 +438,15 @@ class ObjectStore {
__le32 largest_data_off_in_tbl;
__le32 fadvise_flags;

TransactionData() :
TransactionData() noexcept :
ops(0),
largest_data_len(0),
largest_data_off(0),
largest_data_off_in_tbl(0),
fadvise_flags(0) { }

// override default move operations to reset default values
TransactionData(TransactionData&& other) :
TransactionData(TransactionData&& other) noexcept :
ops(other.ops),
largest_data_len(other.largest_data_len),
largest_data_off(other.largest_data_off),
Expand All @@ -458,7 +458,7 @@ class ObjectStore {
other.largest_data_off_in_tbl = 0;
other.fadvise_flags = 0;
}
TransactionData& operator=(TransactionData&& other) {
TransactionData& operator=(TransactionData&& other) noexcept {
ops = other.ops;
largest_data_len = other.largest_data_len;
largest_data_off = other.largest_data_off;
Expand Down Expand Up @@ -518,7 +518,7 @@ class ObjectStore {
}

// override default move operations to reset default values
Transaction(Transaction&& other) :
Transaction(Transaction&& other) noexcept :
data(std::move(other.data)),
osr(other.osr),
use_tbl(other.use_tbl),
Expand All @@ -539,7 +539,7 @@ class ObjectStore {
other.object_id = 0;
}

Transaction& operator=(Transaction&& other) {
Transaction& operator=(Transaction&& other) noexcept {
data = std::move(other.data);
osr = other.osr;
use_tbl = other.use_tbl;
Expand Down Expand Up @@ -630,7 +630,7 @@ class ObjectStore {
return use_tbl;
}

void swap(Transaction& other) {
void swap(Transaction& other) noexcept {
std::swap(data, other.data);
std::swap(on_applied, other.on_applied);
std::swap(on_commit, other.on_commit);
Expand Down