mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Explicitly std::move() returned std::vector<Mapping>.
Otherwise, C++11-compliant compilers may select PosixErrorOr(const T&) as the relevant constructor, and fail because std::vector<Mapping> is not copyable (because Mapping is not copyable). This is a C++11 defect that is fixed in C++14 (and in C++11 mode for Clang, but not GCC). See DR 1579, http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579. PiperOrigin-RevId: 230767401 Change-Id: I65f481f5188d91db6cbbbd65ed0a60bc55df3401
This commit is contained in:
@@ -106,7 +106,7 @@ PosixErrorOr<std::vector<Mapping>> CreateFragmentedRegion(const int size,
|
||||
// The mappings above have taken ownership of the region.
|
||||
region.release();
|
||||
|
||||
return pages;
|
||||
return std::move(pages);
|
||||
}
|
||||
|
||||
// A contiguous iov that is heavily fragmented in FileMem can still be sent
|
||||
|
||||
Reference in New Issue
Block a user