diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2017-09-13 17:00:26 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2017-09-13 17:00:26 +0300 |
commit | 17ada3fb9c18873e438bad66e5bce5efc415d4ff (patch) | |
tree | 6a352128b37bd11f8d6b337d210e673119fbcca9 /test/tests/coroutines.cpp | |
parent | 138a4cebf654500e8ac6595384f7de831777ad97 (diff) |
Reworked Coroutines TS support so i/o is initiated immediately, not on co_await.
Refreshed the free functions.
Diffstat (limited to 'test/tests/coroutines.cpp')
-rw-r--r-- | test/tests/coroutines.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/tests/coroutines.cpp b/test/tests/coroutines.cpp index 2e1cb8da..480df16c 100644 --- a/test/tests/coroutines.cpp +++ b/test/tests/coroutines.cpp @@ -29,8 +29,8 @@ Distributed under the Boost Software License, Version 1.0. static inline void TestAsyncFileHandleCoroutines() { - namespace afio = AFIO_V2_NAMESPACE; #ifdef __cpp_coroutines + namespace afio = AFIO_V2_NAMESPACE; afio::io_service service; afio::async_file_handle h = afio::async_file_handle::async_file(service, {}, "temp", afio::file_handle::mode::write, afio::file_handle::creation::if_needed, afio::file_handle::caching::only_metadata, afio::file_handle::flag::unlink_on_close).value(); h.truncate(1024 * 4096); @@ -41,7 +41,7 @@ static inline void TestAsyncFileHandleCoroutines() afio::async_file_handle::const_buffer_type bt{buffer}; for(size_t n = 0; n < 128; n++) { - auto written = co_await h.co_write({bt, n * 32768 + no * 4096}); + auto written = co_await h.co_write({bt, n * 32768 + no * 4096}).value(); written.value(); } }; |