Skip to content

Commit 3e53f55

Browse files
Piotr SzczepanskikevinAlbs
Piotr Szczepanski
authored andcommitted
CXX-1688 Fix building with GCC 8.x
1 parent 6c70982 commit 3e53f55

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/mongocxx/options/private/transaction.hh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ class transaction::impl {
6161
if (!rc) {
6262
return {};
6363
}
64-
return {stdx::make_unique<read_concern::impl>(libmongoc::read_concern_copy(rc))};
64+
class read_concern rci(
65+
stdx::make_unique<read_concern::impl>(libmongoc::read_concern_copy(rc)));
66+
return stdx::optional<class read_concern>(std::move(rci));
6567
}
6668

6769
void write_concern(const class write_concern& wc) {
@@ -74,7 +76,9 @@ class transaction::impl {
7476
if (!wc) {
7577
return {};
7678
}
77-
return {stdx::make_unique<write_concern::impl>(libmongoc::write_concern_copy(wc))};
79+
class write_concern wci(
80+
stdx::make_unique<write_concern::impl>(libmongoc::write_concern_copy(wc)));
81+
return stdx::optional<class write_concern>(std::move(wci));
7882
}
7983

8084
void read_preference(const class read_preference& rp) {
@@ -87,7 +91,9 @@ class transaction::impl {
8791
if (!rp) {
8892
return {};
8993
}
90-
return {stdx::make_unique<read_preference::impl>(libmongoc::read_prefs_copy(rp))};
94+
class read_preference rpi(
95+
stdx::make_unique<read_preference::impl>(libmongoc::read_prefs_copy(rp)));
96+
return stdx::optional<class read_preference>(std::move(rpi));
9197
}
9298

9399
mongoc_transaction_opt_t* get_transaction_opt_t() const noexcept {

0 commit comments

Comments
 (0)