From patchwork Tue Jan 26 13:04:15 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: 11007 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 24C35C0F2B for ; Tue, 26 Jan 2021 13:04:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E8E5468304; Tue, 26 Jan 2021 14:04:24 +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="Rnd40kMN"; 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 BEEF468301 for ; Tue, 26 Jan 2021 14:04:23 +0100 (CET) Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:169:7140:510d:40f3:f9f9:5153]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1B5BA2C1; Tue, 26 Jan 2021 14:04:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1611666262; bh=WwXESPQ4ZZ+F4o511mNmyphQPbZmeyVqWi9xOy213HU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rnd40kMNleLomPcHFpQWnGtyL5S/3Oz0FTv9FDOIYnvgxE8FHw5hXFP66Xb9YHsY3 oWhvT27Zm1jaOt/5Ittj390py/svPJ8ZCDcI5ReYDttf4ibtmtEBvxV3MCItSbDE3p sXHrEGU7+6j0FN2zjajMOxM0u5stO2JKq+gM7HDI= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Tue, 26 Jan 2021 14:04:15 +0100 Message-Id: <20210126130415.26849-3-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 2/2] Revert "libcamera: Use helper variable template 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 6cbdc2859963e17bc897a4022f1d68170477d888. Signed-off-by: Jean-Michel Hautbois --- include/libcamera/bound_method.h | 2 +- include/libcamera/controls.h | 12 ++++---- include/libcamera/object.h | 2 +- include/libcamera/signal.h | 4 +-- include/libcamera/span.h | 48 ++++++++++++++++---------------- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/include/libcamera/bound_method.h b/include/libcamera/bound_method.h index feac51da..95a95653 100644 --- a/include/libcamera/bound_method.h +++ b/include/libcamera/bound_method.h @@ -63,7 +63,7 @@ public: } virtual ~BoundMethodBase() = default; - template> * = nullptr> + template::value> * = nullptr> bool match(T *obj) { return obj == obj_; } bool match(Object *object) { return object == object_; } diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index dc549a92..3b7f3347 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -98,7 +98,7 @@ public: #ifndef __DOXYGEN__ template::value && details::control_type::value && - !std::is_same_v>, + !std::is_same>::value, std::nullptr_t> = nullptr> ControlValue(const T &value) : type_(ControlTypeNone), numElements_(0) @@ -108,7 +108,7 @@ public: } template::value || - std::is_same_v>, + std::is_same>::value, std::nullptr_t> = nullptr> #else template @@ -142,7 +142,7 @@ public: #ifndef __DOXYGEN__ template::value && - !std::is_same_v>, + !std::is_same>::value, std::nullptr_t> = nullptr> T get() const { @@ -153,7 +153,7 @@ public: } template::value || - std::is_same_v>, + std::is_same>::value, std::nullptr_t> = nullptr> #else template @@ -170,7 +170,7 @@ public: #ifndef __DOXYGEN__ template::value && - !std::is_same_v>, + !std::is_same>::value, std::nullptr_t> = nullptr> void set(const T &value) { @@ -179,7 +179,7 @@ public: } template::value || - std::is_same_v>, + std::is_same>::value, std::nullptr_t> = nullptr> #else template diff --git a/include/libcamera/object.h b/include/libcamera/object.h index 423208db..a1882f05 100644 --- a/include/libcamera/object.h +++ b/include/libcamera/object.h @@ -32,7 +32,7 @@ public: void postMessage(std::unique_ptr msg); template> * = nullptr> + typename std::enable_if_t::value> * = nullptr> R invokeMethod(R (T::*func)(FuncArgs...), ConnectionType type, Args... args) { diff --git a/include/libcamera/signal.h b/include/libcamera/signal.h index 46d917d5..5bcd7a77 100644 --- a/include/libcamera/signal.h +++ b/include/libcamera/signal.h @@ -44,7 +44,7 @@ public: } #ifndef __DOXYGEN__ - template> * = nullptr> + template::value> * = nullptr> void connect(T *obj, R (T::*func)(Args...), ConnectionType type = ConnectionTypeAuto) { @@ -52,7 +52,7 @@ public: SignalBase::connect(new BoundMethodMember(obj, object, func, type)); } - template> * = nullptr> + template::value> * = nullptr> #else template #endif diff --git a/include/libcamera/span.h b/include/libcamera/span.h index d720adb8..91e9f974 100644 --- a/include/libcamera/span.h +++ b/include/libcamera/span.h @@ -125,8 +125,8 @@ public: template constexpr Span(element_type (&arr)[N], - std::enable_if_t (*)[], - element_type (*)[]> && + std::enable_if_t (*)[], + element_type (*)[]>::value && N == Extent, std::nullptr_t> = nullptr) noexcept : data_(arr) @@ -135,8 +135,8 @@ public: template constexpr Span(std::array &arr, - std::enable_if_t (*)[], - element_type (*)[]> && + std::enable_if_t (*)[], + element_type (*)[]>::value && N == Extent, std::nullptr_t> = nullptr) noexcept : data_(arr.data()) @@ -145,8 +145,8 @@ public: template constexpr Span(const std::array &arr, - std::enable_if_t (*)[], - element_type (*)[]> && + std::enable_if_t (*)[], + element_type (*)[]>::value && N == Extent, std::nullptr_t> = nullptr) noexcept : data_(arr.data()) @@ -157,9 +157,9 @@ public: explicit constexpr Span(Container &cont, std::enable_if_t::value && !details::is_array::value && - !std::is_array_v && - std::is_convertible_v (*)[], - element_type (*)[]>, + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)) { @@ -169,9 +169,9 @@ public: explicit constexpr Span(const Container &cont, std::enable_if_t::value && !details::is_array::value && - !std::is_array_v && - std::is_convertible_v (*)[], - element_type (*)[]>, + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)) { @@ -180,7 +180,7 @@ public: template explicit constexpr Span(const Span &s, - std::enable_if_t && + std::enable_if_t::value && N == Extent, std::nullptr_t> = nullptr) noexcept : data_(s.data()) @@ -293,8 +293,8 @@ public: template constexpr Span(element_type (&arr)[N], - std::enable_if_t (*)[], - element_type (*)[]>, + std::enable_if_t (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) noexcept : data_(arr), size_(N) { @@ -302,8 +302,8 @@ public: template constexpr Span(std::array &arr, - std::enable_if_t (*)[], - element_type (*)[]>, + std::enable_if_t (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) noexcept : data_(utils::data(arr)), size_(N) { @@ -319,9 +319,9 @@ public: constexpr Span(Container &cont, std::enable_if_t::value && !details::is_array::value && - !std::is_array_v && - std::is_convertible_v (*)[], - element_type (*)[]>, + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)), size_(utils::size(cont)) { @@ -331,9 +331,9 @@ public: constexpr Span(const Container &cont, std::enable_if_t::value && !details::is_array::value && - !std::is_array_v && - std::is_convertible_v (*)[], - element_type (*)[]>, + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)), size_(utils::size(cont)) { @@ -341,7 +341,7 @@ public: template constexpr Span(const Span &s, - std::enable_if_t, + std::enable_if_t::value, std::nullptr_t> = nullptr) noexcept : data_(s.data()), size_(s.size()) {