diff options
author | Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> | 2021-01-26 14:04:15 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-01-31 17:52:17 +0200 |
commit | c763ae023d9b64e7910c2dfc849f6c1f5081f657 (patch) | |
tree | 0d97f16f993b6a1b1740a684768ab3586998f457 /include | |
parent | 33bfe7b7ef68d6221ad340ad117815e30f8fe6aa (diff) |
Revert "libcamera: Use helper variable template for type traits"
Some applications may not be compliant with C++17 (Chromium, as an
example). Keep the C++17 features for libcamera internals, and C++14
compliance for public API.
This reverts commit 6cbdc2859963e17bc897a4022f1d68170477d888.
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/bound_method.h | 2 | ||||
-rw-r--r-- | include/libcamera/controls.h | 12 | ||||
-rw-r--r-- | include/libcamera/object.h | 2 | ||||
-rw-r--r-- | include/libcamera/signal.h | 4 | ||||
-rw-r--r-- | 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<typename T, typename std::enable_if_t<!std::is_same_v<Object, T>> * = nullptr> + template<typename T, typename std::enable_if_t<!std::is_same<Object, T>::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<typename T, typename std::enable_if_t<!details::is_span<T>::value && details::control_type<T>::value && - !std::is_same_v<std::string, std::remove_cv_t<T>>, + !std::is_same<std::string, std::remove_cv_t<T>>::value, std::nullptr_t> = nullptr> ControlValue(const T &value) : type_(ControlTypeNone), numElements_(0) @@ -108,7 +108,7 @@ public: } template<typename T, typename std::enable_if_t<details::is_span<T>::value || - std::is_same_v<std::string, std::remove_cv_t<T>>, + std::is_same<std::string, std::remove_cv_t<T>>::value, std::nullptr_t> = nullptr> #else template<typename T> @@ -142,7 +142,7 @@ public: #ifndef __DOXYGEN__ template<typename T, typename std::enable_if_t<!details::is_span<T>::value && - !std::is_same_v<std::string, std::remove_cv_t<T>>, + !std::is_same<std::string, std::remove_cv_t<T>>::value, std::nullptr_t> = nullptr> T get() const { @@ -153,7 +153,7 @@ public: } template<typename T, typename std::enable_if_t<details::is_span<T>::value || - std::is_same_v<std::string, std::remove_cv_t<T>>, + std::is_same<std::string, std::remove_cv_t<T>>::value, std::nullptr_t> = nullptr> #else template<typename T> @@ -170,7 +170,7 @@ public: #ifndef __DOXYGEN__ template<typename T, typename std::enable_if_t<!details::is_span<T>::value && - !std::is_same_v<std::string, std::remove_cv_t<T>>, + !std::is_same<std::string, std::remove_cv_t<T>>::value, std::nullptr_t> = nullptr> void set(const T &value) { @@ -179,7 +179,7 @@ public: } template<typename T, typename std::enable_if_t<details::is_span<T>::value || - std::is_same_v<std::string, std::remove_cv_t<T>>, + std::is_same<std::string, std::remove_cv_t<T>>::value, std::nullptr_t> = nullptr> #else template<typename T> 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<Message> msg); template<typename T, typename R, typename... FuncArgs, typename... Args, - typename std::enable_if_t<std::is_base_of_v<Object, T>> * = nullptr> + typename std::enable_if_t<std::is_base_of<Object, 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<typename T, typename R, typename std::enable_if_t<std::is_base_of_v<Object, T>> * = nullptr> + template<typename T, typename R, typename std::enable_if_t<std::is_base_of<Object, T>::value> * = nullptr> void connect(T *obj, R (T::*func)(Args...), ConnectionType type = ConnectionTypeAuto) { @@ -52,7 +52,7 @@ public: SignalBase::connect(new BoundMethodMember<T, void, Args...>(obj, object, func, type)); } - template<typename T, typename R, typename std::enable_if_t<!std::is_base_of_v<Object, T>> * = nullptr> + template<typename T, typename R, typename std::enable_if_t<!std::is_base_of<Object, T>::value> * = nullptr> #else template<typename T, typename R> #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<std::size_t N> constexpr Span(element_type (&arr)[N], - std::enable_if_t<std::is_convertible_v<std::remove_pointer_t<decltype(utils::data(arr))> (*)[], - element_type (*)[]> && + std::enable_if_t<std::is_convertible<std::remove_pointer_t<decltype(utils::data(arr))> (*)[], + element_type (*)[]>::value && N == Extent, std::nullptr_t> = nullptr) noexcept : data_(arr) @@ -135,8 +135,8 @@ public: template<std::size_t N> constexpr Span(std::array<value_type, N> &arr, - std::enable_if_t<std::is_convertible_v<std::remove_pointer_t<decltype(utils::data(arr))> (*)[], - element_type (*)[]> && + std::enable_if_t<std::is_convertible<std::remove_pointer_t<decltype(utils::data(arr))> (*)[], + element_type (*)[]>::value && N == Extent, std::nullptr_t> = nullptr) noexcept : data_(arr.data()) @@ -145,8 +145,8 @@ public: template<std::size_t N> constexpr Span(const std::array<value_type, N> &arr, - std::enable_if_t<std::is_convertible_v<std::remove_pointer_t<decltype(utils::data(arr))> (*)[], - element_type (*)[]> && + std::enable_if_t<std::is_convertible<std::remove_pointer_t<decltype(utils::data(arr))> (*)[], + 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<!details::is_span<Container>::value && !details::is_array<Container>::value && - !std::is_array_v<Container> && - std::is_convertible_v<std::remove_pointer_t<decltype(utils::data(cont))> (*)[], - element_type (*)[]>, + !std::is_array<Container>::value && + std::is_convertible<std::remove_pointer_t<decltype(utils::data(cont))> (*)[], + 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<!details::is_span<Container>::value && !details::is_array<Container>::value && - !std::is_array_v<Container> && - std::is_convertible_v<std::remove_pointer_t<decltype(utils::data(cont))> (*)[], - element_type (*)[]>, + !std::is_array<Container>::value && + std::is_convertible<std::remove_pointer_t<decltype(utils::data(cont))> (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)) { @@ -180,7 +180,7 @@ public: template<class U, std::size_t N> explicit constexpr Span(const Span<U, N> &s, - std::enable_if_t<std::is_convertible_v<U (*)[], element_type (*)[]> && + std::enable_if_t<std::is_convertible<U (*)[], element_type (*)[]>::value && N == Extent, std::nullptr_t> = nullptr) noexcept : data_(s.data()) @@ -293,8 +293,8 @@ public: template<std::size_t N> constexpr Span(element_type (&arr)[N], - std::enable_if_t<std::is_convertible_v<std::remove_pointer_t<decltype(utils::data(arr))> (*)[], - element_type (*)[]>, + std::enable_if_t<std::is_convertible<std::remove_pointer_t<decltype(utils::data(arr))> (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) noexcept : data_(arr), size_(N) { @@ -302,8 +302,8 @@ public: template<std::size_t N> constexpr Span(std::array<value_type, N> &arr, - std::enable_if_t<std::is_convertible_v<std::remove_pointer_t<decltype(utils::data(arr))> (*)[], - element_type (*)[]>, + std::enable_if_t<std::is_convertible<std::remove_pointer_t<decltype(utils::data(arr))> (*)[], + 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<!details::is_span<Container>::value && !details::is_array<Container>::value && - !std::is_array_v<Container> && - std::is_convertible_v<std::remove_pointer_t<decltype(utils::data(cont))> (*)[], - element_type (*)[]>, + !std::is_array<Container>::value && + std::is_convertible<std::remove_pointer_t<decltype(utils::data(cont))> (*)[], + 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<!details::is_span<Container>::value && !details::is_array<Container>::value && - !std::is_array_v<Container> && - std::is_convertible_v<std::remove_pointer_t<decltype(utils::data(cont))> (*)[], - element_type (*)[]>, + !std::is_array<Container>::value && + std::is_convertible<std::remove_pointer_t<decltype(utils::data(cont))> (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)), size_(utils::size(cont)) { @@ -341,7 +341,7 @@ public: template<class U, std::size_t N> constexpr Span(const Span<U, N> &s, - std::enable_if_t<std::is_convertible_v<U (*)[], element_type (*)[]>, + std::enable_if_t<std::is_convertible<U (*)[], element_type (*)[]>::value, std::nullptr_t> = nullptr) noexcept : data_(s.data()), size_(s.size()) { |