From patchwork Mon Mar 10 17:03:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22949 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 21A5FC32F1 for ; Mon, 10 Mar 2025 17:04:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CDF6268826; Mon, 10 Mar 2025 18:04:01 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="moy1RGzw"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B3ED7687FA for ; Mon, 10 Mar 2025 18:04:00 +0100 (CET) Received: from pb-laptop.local (185.221.143.221.nat.pool.zt.hu [185.221.143.221]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DE747227 for ; Mon, 10 Mar 2025 18:02:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1741626144; bh=as5+oycz/vhk++PoMmE3FFmHotRQ8V7sMzLzy+7nIB0=; h=From:To:Subject:Date:From; b=moy1RGzwDxuqNesIR8G1cAhXPnvW6cYxOvSBtidLwkJKjlWIPzfq1jSie/mG7+lBq Wl3mJcQhe2uTeZkX3X1FUCzsIhWyUW9LiSJZsQoiqDFRQ+eBBaQWsPbQRWiIKm18+A uAToY+x1LVTovaFT4UXBhweWiE16MvrPD9NnBqcc= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] libcamera: base: span: Explicitly default copy assignment Date: Mon, 10 Mar 2025 18:03:56 +0100 Message-ID: <20250310170356.185368-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The `dynamic_extent` specialization is currently not trivially copyable unlike its standard counterpart, `std::span`. This is because the copy assignment operator is user-defined. Explicitly default it just like it is done in the main template definition. Signed-off-by: Barnabás Pőcze Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- include/libcamera/base/span.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/libcamera/base/span.h b/include/libcamera/base/span.h index 92cce4f05..806db106e 100644 --- a/include/libcamera/base/span.h +++ b/include/libcamera/base/span.h @@ -346,13 +346,7 @@ public: } constexpr Span(const Span &other) noexcept = default; - - constexpr Span &operator=(const Span &other) noexcept - { - data_ = other.data_; - size_ = other.size_; - return *this; - } + constexpr Span &operator=(const Span &other) noexcept = default; constexpr iterator begin() const { return data(); } constexpr const_iterator cbegin() const { return begin(); }