From 19564cb4f77660cdb2f980ca619d4b979b9fe342 Mon Sep 17 00:00:00 2001 From: Boyuan Yang Date: Mon, 27 Nov 2023 22:46:29 -0500 Subject: New upstream version 0.19.0 --- examples/file_reader.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'examples/file_reader.cc') diff --git a/examples/file_reader.cc b/examples/file_reader.cc index b096722..a01b7ab 100644 --- a/examples/file_reader.cc +++ b/examples/file_reader.cc @@ -82,7 +82,14 @@ std::unique_ptr FileReader::Open( return nullptr; } - return file; + // With C++11, to return |file|, an explicit move is required as the return + // type differs from the local variable. Overload resolution isn't guaranteed + // in this case, though some compilers may adopt the C++14 behavior (C++ + // Standard Core Language Issue #1579, Return by converting move + // constructor): + // https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579 + // To keep things simple we opt for the following compatible form. + return std::unique_ptr(file.release()); } // IVF Frame Header format, from https://wiki.multimedia.cx/index.php/IVF -- cgit v1.2.3