[v1,1/2] libcamera: base: bound_method: Strip qualifiers in argument pack
diff mbox series

Message ID 20260508092816.119642-1-barnabas.pocze@ideasonboard.com
State Accepted
Headers show
Series
  • [v1,1/2] libcamera: base: bound_method: Strip qualifiers in argument pack
Related show

Commit Message

Barnabás Pőcze May 8, 2026, 9:28 a.m. UTC
Having extra qualifiers, especially `const`, simply inhibits optimization
opportunities as it prevents e.g. moving values out of pack object. So
strip the qualifiers.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 include/libcamera/base/bound_method.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart May 8, 2026, noon UTC | #1
On Fri, May 08, 2026 at 11:28:15AM +0200, Barnabás Pőcze wrote:
> Having extra qualifiers, especially `const`, simply inhibits optimization
> opportunities as it prevents e.g. moving values out of pack object. So
> strip the qualifiers.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  include/libcamera/base/bound_method.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/libcamera/base/bound_method.h b/include/libcamera/base/bound_method.h
> index 91fe8b8cb9..cb642e0a9b 100644
> --- a/include/libcamera/base/bound_method.h
> +++ b/include/libcamera/base/bound_method.h
> @@ -39,7 +39,7 @@ public:
>  	{
>  	}
>  
> -	std::tuple<typename std::remove_reference_t<Args>...> args_;
> +	std::tuple<std::remove_cv_t<std::remove_reference_t<Args>>...> args_;
>  	R ret_;
>  };
>  
> @@ -53,7 +53,7 @@ public:
>  	{
>  	}
>  
> -	std::tuple<typename std::remove_reference_t<Args>...> args_;
> +	std::tuple<std::remove_cv_t<std::remove_reference_t<Args>>...> args_;
>  };
>  
>  class BoundMethodBase

Patch
diff mbox series

diff --git a/include/libcamera/base/bound_method.h b/include/libcamera/base/bound_method.h
index 91fe8b8cb9..cb642e0a9b 100644
--- a/include/libcamera/base/bound_method.h
+++ b/include/libcamera/base/bound_method.h
@@ -39,7 +39,7 @@  public:
 	{
 	}
 
-	std::tuple<typename std::remove_reference_t<Args>...> args_;
+	std::tuple<std::remove_cv_t<std::remove_reference_t<Args>>...> args_;
 	R ret_;
 };
 
@@ -53,7 +53,7 @@  public:
 	{
 	}
 
-	std::tuple<typename std::remove_reference_t<Args>...> args_;
+	std::tuple<std::remove_cv_t<std::remove_reference_t<Args>>...> args_;
 };
 
 class BoundMethodBase