From patchwork Thu Dec 5 09:23:06 2024 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: 22171 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 B9B79BDB1C for ; Thu, 5 Dec 2024 09:23:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 602A5660EB; Thu, 5 Dec 2024 10:23:13 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=protonmail.com header.i=@protonmail.com header.b="pXoZhVnP"; dkim-atps=neutral Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8D598660E1 for ; Thu, 5 Dec 2024 10:23:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1733390590; x=1733649790; bh=Px5dd2eghGhMD9W1LLrCTb99FJrWCLoaaIMWnZx3ty8=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=pXoZhVnPv6d1loI3EeHcKu7jbQS5ntHAwlAG4bXfjbv77qqtcGRNgJ4uzYpvdtXQ2 gRz+1N7xgwwWA6nFD4gSuCjuW9BgbuvPhgVLLkdZhk+J6Qf4gYr9kmCBpmKUBu24CC a6ZicXDPieLG+nII5dTYHSiL53T/YtQO3IBDk0sOhTFYztpgHX2XmJKpyENeFxlPPi qgj20CU5g0rh69EGLhMQ8/J4r+0mVEPdULdG1BezOITJ1nRNCAl5fyI6bELsPmQk5w 9UqM0terX189f8gmvbGPC8SmqLSeK/Yk5JEmFlTvxnK8I66QMUfzB/OuFPPEi2AEfb ksn+hA8wcO7yA== Date: Thu, 05 Dec 2024 09:23:06 +0000 To: libcamera-devel@lists.libcamera.org From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH v2 2/2] libcamera: utils: StringSplitter: Add `operator==` Message-ID: <20241205092258.1058077-2-pobrn@protonmail.com> In-Reply-To: <20241205092258.1058077-1-pobrn@protonmail.com> References: <20241205092258.1058077-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton X-Pm-Message-ID: b58a1e8768925a6c5800ad83c039c7c2b273f3dd 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" If `cpp_debugstl` is enabled in the build configuration, then libstdc++ will try to use `==` on operators in certain cases to carry out extra checks. This leads to build failures because `StringSplitter::iterator` has no `operator==`. Implement `operator==`, and express `operator!=` in terms of it. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- include/libcamera/base/utils.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h index c4a06660..780aeda6 100644 --- a/include/libcamera/base/utils.h +++ b/include/libcamera/base/utils.h @@ -205,9 +205,14 @@ public: iterator &operator++(); std::string operator*() const; + bool operator==(const iterator &other) const + { + return pos_ == other.pos_; + } + bool operator!=(const iterator &other) const { - return pos_ != other.pos_; + return !(*this == other); } private: