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

paul.elder at ideasonboard.com paul.elder at ideasonboard.com
Tue Sep 29 04:33:55 CEST 2020


Hi Laurent,

On Tue, Sep 29, 2020 at 04:18:50AM +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: Paul Elder <paul.elder at ideasonboard.com>

> ---
>  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


More information about the libcamera-devel mailing list