[libcamera-devel] [PATCH] libcamera: span: Use default copy assignemnt operator

Niklas Söderlund niklas.soderlund at ragnatech.se
Tue Sep 29 07:20:16 CEST 2020


Hi Laurent,

Thanks for your work.

On 2020-09-29 04:18:50 +0300, Laurent Pinchart wrote:
> The custom implementation of the copy assignment operator is identical
> to the one the compiler would generate. Replace it by the default.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

> ---
>  include/libcamera/span.h | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/include/libcamera/span.h b/include/libcamera/span.h
> index 738af6aca871..a53a80b81640 100644
> --- a/include/libcamera/span.h
> +++ b/include/libcamera/span.h
> @@ -188,12 +188,7 @@ public:
>  	}
>  
>  	constexpr Span(const Span &other) noexcept = default;
> -
> -	constexpr Span &operator=(const Span &other) noexcept
> -	{
> -		data_ = other.data_;
> -		return *this;
> -	}
> +	constexpr Span &operator=(const Span &other) noexcept = default;
>  
>  	constexpr iterator begin() const { return data(); }
>  	constexpr const_iterator cbegin() const { return begin(); }
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list