From patchwork Tue Jan 26 13:04:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 11006 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 C7AB2C0F2B for ; Tue, 26 Jan 2021 13:04:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 999BE68300; Tue, 26 Jan 2021 14:04:23 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="waHFRPIh"; 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 B4AD0682F0 for ; Tue, 26 Jan 2021 14:04:21 +0100 (CET) Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:169:7140:510d:40f3:f9f9:5153]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 636082E0; Tue, 26 Jan 2021 14:04:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1611666261; bh=w5OwvBYRaQUEAgyHtdkv9HAIs9ErRn8dxB+0biub8nE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=waHFRPIhq5TAkZrJ1aVe500oggKchrpRdCPLMJdxBf3W963QsqXqkUP1i01PGCVgk FmYLmmhdqucGrFfN1s28TtbP5F0659vU7A2s2nBPKLRcOP0AmDDqy/AlCyDzZ/AUze psCQ9UY0ZgKtPm1CmKyqpeiIhbmNPA16UoS3rCQI= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Tue, 26 Jan 2021 14:04:14 +0100 Message-Id: <20210126130415.26849-2-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210126130415.26849-1-jeanmichel.hautbois@ideasonboard.com> References: <20210126130415.26849-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/2] Revert "libcamera: span: Provide and use helper variable templates for type traits" 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" This reverts commit 8e42c2feb7ff7c350ffbbf97dd963dfd54e21faa. Signed-off-by: Jean-Michel Hautbois --- include/libcamera/controls.h | 12 ++++++------ include/libcamera/span.h | 22 ++++++++-------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index 3634dc43..dc549a92 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -96,7 +96,7 @@ public: ControlValue(); #ifndef __DOXYGEN__ - template && + template::value && details::control_type::value && !std::is_same_v>, std::nullptr_t> = nullptr> @@ -107,7 +107,7 @@ public: &value, 1, sizeof(T)); } - template || + template::value || std::is_same_v>, std::nullptr_t> = nullptr> #else @@ -141,7 +141,7 @@ public: } #ifndef __DOXYGEN__ - template && + template::value && !std::is_same_v>, std::nullptr_t> = nullptr> T get() const @@ -152,7 +152,7 @@ public: return *reinterpret_cast(data().data()); } - template || + template::value || std::is_same_v>, std::nullptr_t> = nullptr> #else @@ -169,7 +169,7 @@ public: } #ifndef __DOXYGEN__ - template && + template::value && !std::is_same_v>, std::nullptr_t> = nullptr> void set(const T &value) @@ -178,7 +178,7 @@ public: reinterpret_cast(&value), 1, sizeof(T)); } - template || + template::value || std::is_same_v>, std::nullptr_t> = nullptr> #else diff --git a/include/libcamera/span.h b/include/libcamera/span.h index e7ffef12..d720adb8 100644 --- a/include/libcamera/span.h +++ b/include/libcamera/span.h @@ -31,9 +31,6 @@ template struct is_array> : public std::true_type { }; -template -inline constexpr bool is_array_v = is_array::value; - template struct is_span : public std::false_type { }; @@ -42,9 +39,6 @@ template struct is_span> : public std::true_type { }; -template -inline constexpr bool is_span_v = is_span::value; - } /* namespace details */ namespace utils { @@ -161,8 +155,8 @@ public: template explicit constexpr Span(Container &cont, - std::enable_if_t && - !details::is_array_v && + std::enable_if_t::value && + !details::is_array::value && !std::is_array_v && std::is_convertible_v (*)[], element_type (*)[]>, @@ -173,8 +167,8 @@ public: template explicit constexpr Span(const Container &cont, - std::enable_if_t && - !details::is_array_v && + std::enable_if_t::value && + !details::is_array::value && !std::is_array_v && std::is_convertible_v (*)[], element_type (*)[]>, @@ -323,8 +317,8 @@ public: template constexpr Span(Container &cont, - std::enable_if_t && - !details::is_array_v && + std::enable_if_t::value && + !details::is_array::value && !std::is_array_v && std::is_convertible_v (*)[], element_type (*)[]>, @@ -335,8 +329,8 @@ public: template constexpr Span(const Container &cont, - std::enable_if_t && - !details::is_array_v && + std::enable_if_t::value && + !details::is_array::value && !std::is_array_v && std::is_convertible_v (*)[], element_type (*)[]>,