libcamera: matrix: Improve comment related to C++20
diff mbox series

Message ID 20260609155043.1121340-1-laurent.pinchart@ideasonboard.com
State New
Headers show
Series
  • libcamera: matrix: Improve comment related to C++20
Related show

Commit Message

Laurent Pinchart June 9, 2026, 3:50 p.m. UTC
It was envisioned that the Matrix::data_ initializer could be dropped
once moving to C++20. Unfortunately older compilers don't agree. Update
the comment accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 include/libcamera/internal/matrix.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)


base-commit: 5701eb5f47cf3649e2746a2082c7bb3e0a0577e8

Comments

Kieran Bingham June 9, 2026, 5:07 p.m. UTC | #1
Quoting Laurent Pinchart (2026-06-09 16:50:43)
> It was envisioned that the Matrix::data_ initializer could be dropped
> once moving to C++20. Unfortunately older compilers don't agree. Update
> the comment accordingly.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  include/libcamera/internal/matrix.h | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/include/libcamera/internal/matrix.h b/include/libcamera/internal/matrix.h
> index 0f72263f2536..4900dcc0a419 100644
> --- a/include/libcamera/internal/matrix.h
> +++ b/include/libcamera/internal/matrix.h
> @@ -117,9 +117,11 @@ public:
>  
>  private:
>         /*
> -        * \todo The initializer is only necessary for the constructor to be
> -        * constexpr in C++17. Remove the initializer as soon as we are on
> -        * C++20.
> +        * \todo The initializer should be only necessary for the constructor to
> +        * be constexpr in C++17. However, older gcc versions (at least 9 and
> +        * 12, but apparently not 10), as well as clang versions (at least 14
> +        * and 19), throw compilation errors, even with C++20. Remove the
> +        * initializer once we can drop support of those old compiler versions.
>          */
>         std::array<T, Rows * Cols> data_ = {};
>  };
> 
> base-commit: 5701eb5f47cf3649e2746a2082c7bb3e0a0577e8
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/include/libcamera/internal/matrix.h b/include/libcamera/internal/matrix.h
index 0f72263f2536..4900dcc0a419 100644
--- a/include/libcamera/internal/matrix.h
+++ b/include/libcamera/internal/matrix.h
@@ -117,9 +117,11 @@  public:
 
 private:
 	/*
-	 * \todo The initializer is only necessary for the constructor to be
-	 * constexpr in C++17. Remove the initializer as soon as we are on
-	 * C++20.
+	 * \todo The initializer should be only necessary for the constructor to
+	 * be constexpr in C++17. However, older gcc versions (at least 9 and
+	 * 12, but apparently not 10), as well as clang versions (at least 14
+	 * and 19), throw compilation errors, even with C++20. Remove the
+	 * initializer once we can drop support of those old compiler versions.
 	 */
 	std::array<T, Rows * Cols> data_ = {};
 };