Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2021-02-15 20:08:10 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2021-02-15 20:08:10 +0300
commit2c3586fb710d15bf67b92e472d11b9a9f85cbd06 (patch)
treece1b95c80a2fe6bcbfe97ae61dfd6c813e244d10 /test-packaging
parent8a89e98108296dbceca12e1648f5bb4ce2ca2d01 (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.cpp4
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;