aboutsummaryrefslogtreecommitdiff
path: root/examples/file_reader.cc
diff options
context:
space:
mode:
authorSebastian Ramacher <sramacher@debian.org>2024-12-29 12:50:37 +0000
committerSebastian Ramacher <sramacher@debian.org>2024-12-29 12:50:37 +0000
commit873c687c09e0a1a78a8f3601d31330ad1897e484 (patch)
treeff2fa2e2d27b55c002a6d46d50aab2c66e0bf21a /examples/file_reader.cc
parent395b1f6877fbc2666383f3428f17400c35aa52a4 (diff)
parentb9ae809f200982119d16ec9613f3db95eca923b9 (diff)
downloadlibgav1-873c687c09e0a1a78a8f3601d31330ad1897e484.tar.gz
libgav1-873c687c09e0a1a78a8f3601d31330ad1897e484.tar.bz2
libgav1-873c687c09e0a1a78a8f3601d31330ad1897e484.zip
Merge branch 'master' into 'scrub-obsolete'
# Conflicts: # debian/changelog
Diffstat (limited to 'examples/file_reader.cc')
-rw-r--r--examples/file_reader.cc9
1 files changed, 8 insertions, 1 deletions
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<FileReaderInterface> 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<FileReaderInterface>(file.release());
}
// IVF Frame Header format, from https://wiki.multimedia.cx/index.php/IVF