[libcamera-devel] [PATCH] android: camera_device: Use std::make_tuple()
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Tue Jun 9 23:11:10 CEST 2020
Until N4387 (https://wg21.link/N4387, applied as a defect report for
C++11), a function could not return a tuple using
copy-list-initialization. This affects gcc-5 that was released before
N4387 was integrated, and causes a compilation error:
../../src/android/camera_device.cpp: In member function ‘std::tuple<unsigned int, unsigned int> CameraDevice::calculateStaticMetadataSize()’:
../../src/android/camera_device.cpp:391:32: error: converting to ‘std::tuple<unsigned int, unsigned int>’ from initializer list would use explicit constructor ‘constexpr std::tuple<_T1, _T2>::tuple(_U1&&, _U2&&) [with _U1 = unsigned int&; _U2 = unsigned int&; <template-parameter-2-3> = void; _T1 = unsigned int; _T2 = unsigned int]’
return { numEntries, byteSize };
Fix it by using std::make_tuple().
Fixes: a80d38109f65 ("android: camera_device: Calculate metadata size")
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
src/android/camera_device.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 7a0dc530e35b..c56e2355f778 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -388,7 +388,7 @@ std::tuple<uint32_t, uint32_t> CameraDevice::calculateStaticMetadataSize()
*/
byteSize += streamConfigurations_.size() * 52;
- return { numEntries, byteSize };
+ return std::make_tuple(numEntries, byteSize);
}
/*
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list