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>2018-10-17 21:23:18 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-10-17 21:23:18 +0300
commitfd12a60d26c80d93185ff0e0da1efa4ddbbf3863 (patch)
treecd4f6676380acf8f5d394494e6b1def7e243e8a8 /include/llfio/v2.0/io_handle.hpp
parentbc1a0df70b896bc5b1852e8281aced96596b27af (diff)
Lots of changes to support latest WG21 SG14 status code, as the erased code is now move-only, which in turn requires the async i/o completion handlers to all use rvalue refs instead of lvalue refs. This helped find and fix a fair few inefficient corner cases along the way, which is great.
Diffstat (limited to 'include/llfio/v2.0/io_handle.hpp')
-rw-r--r--include/llfio/v2.0/io_handle.hpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/llfio/v2.0/io_handle.hpp b/include/llfio/v2.0/io_handle.hpp
index bd9d857a..87bdd0ee 100644
--- a/include/llfio/v2.0/io_handle.hpp
+++ b/include/llfio/v2.0/io_handle.hpp
@@ -216,10 +216,15 @@ public:
io_result() = default;
#endif
~io_result() = default;
+ io_result &operator=(io_result &&) = default; // NOLINT
+#if LLFIO_EXPERIMENTAL_STATUS_CODE
+ io_result(const io_result &) = delete;
+ io_result &operator=(const io_result &) = delete;
+#else
io_result(const io_result &) = default;
- io_result(io_result &&) = default; // NOLINT
io_result &operator=(const io_result &) = default;
- io_result &operator=(io_result &&) = default; // NOLINT
+#endif
+ io_result(io_result &&) = default; // NOLINT
//! Returns bytes transferred
size_type bytes_transferred() noexcept
{
@@ -234,7 +239,7 @@ public:
return _bytes_transferred;
}
};
-#ifndef NDEBUG
+#if !defined(NDEBUG) && !LLFIO_EXPERIMENTAL_STATUS_CODE
// Is trivial in all ways, except default constructibility
static_assert(std::is_trivially_copyable<io_result<buffers_type>>::value, "io_result<buffers_type> is not trivially copyable!");
// static_assert(std::is_trivially_assignable<io_result<buffers_type>, io_result<buffers_type>>::value, "io_result<buffers_type> is not trivially assignable!");
@@ -341,7 +346,7 @@ public:
{
return ret.bytes_transferred();
}
- return ret.error();
+ return std::move(ret).error();
}
/*! \brief Issue a write reordering barrier such that writes preceding the barrier will reach storage