diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2021-02-15 20:08:10 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2021-02-15 20:08:10 +0300 |
commit | 2c3586fb710d15bf67b92e472d11b9a9f85cbd06 (patch) | |
tree | ce1b95c80a2fe6bcbfe97ae61dfd6c813e244d10 /test-packaging | |
parent | 8a89e98108296dbceca12e1648f5bb4ce2ca2d01 (diff) |
Port LLFIO to latest Outcome, whose TRY operation now uses value semantics for the unique temporary and therefore all TRY destinations ought to be rvalue refs.
Diffstat (limited to 'test-packaging')
-rw-r--r-- | test-packaging/example.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test-packaging/example.cpp b/test-packaging/example.cpp index b64a98d2..006d59f5 100644 --- a/test-packaging/example.cpp +++ b/test-packaging/example.cpp @@ -31,11 +31,11 @@ int main() namespace llfio = LLFIO_V2_NAMESPACE; auto r = []() -> llfio::result<int> { - OUTCOME_TRY(auto fh, llfio::file_handle::temp_file()); + OUTCOME_TRY(auto &&fh, llfio::file_handle::temp_file()); static const char *buffers[] = { "He", "llo", " world" }; OUTCOME_TRY(fh.write(0, { { (const llfio::byte *) buffers[0], 2 }, { (const llfio::byte *) buffers[1], 3 }, { (const llfio::byte *) buffers[2], 6 } } )); llfio::byte buffer[64]; - OUTCOME_TRY(auto read, fh.read(0, { {buffer, sizeof(buffer)} })); + OUTCOME_TRY(auto &&read, fh.read(0, { {buffer, sizeof(buffer)} })); if(read != 11) { std::cerr << "FAILURE: Did not read 11 bytes!" << std::endl; |