mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-24 00:55:07 +03:00
libcamera: Drop unnecessary typename keyword used with std::enable_if_t
Usage of the std::enable_if_t type doesn't need to be prefixed by typename. Drop the unnecessary keyword. Reported-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
c19150ea94
commit
1715b7ed08
8 changed files with 33 additions and 33 deletions
|
@ -72,7 +72,7 @@ public:
|
||||||
}
|
}
|
||||||
virtual ~BoundMethodBase() = default;
|
virtual ~BoundMethodBase() = default;
|
||||||
|
|
||||||
template<typename T, typename std::enable_if_t<!std::is_same<Object, T>::value> * = nullptr>
|
template<typename T, std::enable_if_t<!std::is_same<Object, T>::value> * = nullptr>
|
||||||
bool match(T *obj) { return obj == obj_; }
|
bool match(T *obj) { return obj == obj_; }
|
||||||
bool match(Object *object) { return object == object_; }
|
bool match(Object *object) { return object == object_; }
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ struct flags_enable_operators {
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename E>
|
template<typename E>
|
||||||
typename std::enable_if_t<flags_enable_operators<E>::enable, Flags<E>>
|
std::enable_if_t<flags_enable_operators<E>::enable, Flags<E>>
|
||||||
operator|(E lhs, E rhs)
|
operator|(E lhs, E rhs)
|
||||||
{
|
{
|
||||||
using type = std::underlying_type_t<E>;
|
using type = std::underlying_type_t<E>;
|
||||||
|
@ -155,7 +155,7 @@ operator|(E lhs, E rhs)
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename E>
|
template<typename E>
|
||||||
typename std::enable_if_t<flags_enable_operators<E>::enable, Flags<E>>
|
std::enable_if_t<flags_enable_operators<E>::enable, Flags<E>>
|
||||||
operator&(E lhs, E rhs)
|
operator&(E lhs, E rhs)
|
||||||
{
|
{
|
||||||
using type = std::underlying_type_t<E>;
|
using type = std::underlying_type_t<E>;
|
||||||
|
@ -163,7 +163,7 @@ operator&(E lhs, E rhs)
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename E>
|
template<typename E>
|
||||||
typename std::enable_if_t<flags_enable_operators<E>::enable, Flags<E>>
|
std::enable_if_t<flags_enable_operators<E>::enable, Flags<E>>
|
||||||
operator^(E lhs, E rhs)
|
operator^(E lhs, E rhs)
|
||||||
{
|
{
|
||||||
using type = std::underlying_type_t<E>;
|
using type = std::underlying_type_t<E>;
|
||||||
|
@ -171,7 +171,7 @@ operator^(E lhs, E rhs)
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename E>
|
template<typename E>
|
||||||
typename std::enable_if_t<flags_enable_operators<E>::enable, Flags<E>>
|
std::enable_if_t<flags_enable_operators<E>::enable, Flags<E>>
|
||||||
operator~(E rhs)
|
operator~(E rhs)
|
||||||
{
|
{
|
||||||
using type = std::underlying_type_t<E>;
|
using type = std::underlying_type_t<E>;
|
||||||
|
|
|
@ -32,7 +32,7 @@ public:
|
||||||
void postMessage(std::unique_ptr<Message> msg);
|
void postMessage(std::unique_ptr<Message> msg);
|
||||||
|
|
||||||
template<typename T, typename R, typename... FuncArgs, typename... Args,
|
template<typename T, typename R, typename... FuncArgs, typename... Args,
|
||||||
typename std::enable_if_t<std::is_base_of<Object, T>::value> * = nullptr>
|
std::enable_if_t<std::is_base_of<Object, T>::value> * = nullptr>
|
||||||
R invokeMethod(R (T::*func)(FuncArgs...), ConnectionType type,
|
R invokeMethod(R (T::*func)(FuncArgs...), ConnectionType type,
|
||||||
Args&&... args)
|
Args&&... args)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __DOXYGEN__
|
#ifndef __DOXYGEN__
|
||||||
template<typename T, typename R, typename std::enable_if_t<std::is_base_of<Object, T>::value> * = nullptr>
|
template<typename T, typename R, std::enable_if_t<std::is_base_of<Object, T>::value> * = nullptr>
|
||||||
void connect(T *obj, R (T::*func)(Args...),
|
void connect(T *obj, R (T::*func)(Args...),
|
||||||
ConnectionType type = ConnectionTypeAuto)
|
ConnectionType type = ConnectionTypeAuto)
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,7 @@ public:
|
||||||
SignalBase::connect(new BoundMethodMember<T, R, Args...>(obj, object, func, type));
|
SignalBase::connect(new BoundMethodMember<T, R, Args...>(obj, object, func, type));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename R, typename std::enable_if_t<!std::is_base_of<Object, T>::value> * = nullptr>
|
template<typename T, typename R, std::enable_if_t<!std::is_base_of<Object, T>::value> * = nullptr>
|
||||||
#else
|
#else
|
||||||
template<typename T, typename R>
|
template<typename T, typename R>
|
||||||
#endif
|
#endif
|
||||||
|
@ -63,7 +63,7 @@ public:
|
||||||
|
|
||||||
#ifndef __DOXYGEN__
|
#ifndef __DOXYGEN__
|
||||||
template<typename T, typename Func,
|
template<typename T, typename Func,
|
||||||
typename std::enable_if_t<std::is_base_of<Object, T>::value> * = nullptr>
|
std::enable_if_t<std::is_base_of<Object, T>::value> * = nullptr>
|
||||||
void connect(T *obj, Func func, ConnectionType type = ConnectionTypeAuto)
|
void connect(T *obj, Func func, ConnectionType type = ConnectionTypeAuto)
|
||||||
{
|
{
|
||||||
Object *object = static_cast<Object *>(obj);
|
Object *object = static_cast<Object *>(obj);
|
||||||
|
@ -71,7 +71,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename Func,
|
template<typename T, typename Func,
|
||||||
typename std::enable_if_t<!std::is_base_of<Object, T>::value> * = nullptr>
|
std::enable_if_t<!std::is_base_of<Object, T>::value> * = nullptr>
|
||||||
#else
|
#else
|
||||||
template<typename T, typename Func>
|
template<typename T, typename Func>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -99,10 +99,10 @@ public:
|
||||||
ControlValue();
|
ControlValue();
|
||||||
|
|
||||||
#ifndef __DOXYGEN__
|
#ifndef __DOXYGEN__
|
||||||
template<typename T, typename std::enable_if_t<!details::is_span<T>::value &&
|
template<typename T, std::enable_if_t<!details::is_span<T>::value &&
|
||||||
details::control_type<T>::value &&
|
details::control_type<T>::value &&
|
||||||
!std::is_same<std::string, std::remove_cv_t<T>>::value,
|
!std::is_same<std::string, std::remove_cv_t<T>>::value,
|
||||||
std::nullptr_t> = nullptr>
|
std::nullptr_t> = nullptr>
|
||||||
ControlValue(const T &value)
|
ControlValue(const T &value)
|
||||||
: type_(ControlTypeNone), numElements_(0)
|
: type_(ControlTypeNone), numElements_(0)
|
||||||
{
|
{
|
||||||
|
@ -110,9 +110,9 @@ public:
|
||||||
&value, 1, sizeof(T));
|
&value, 1, sizeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename std::enable_if_t<details::is_span<T>::value ||
|
template<typename T, std::enable_if_t<details::is_span<T>::value ||
|
||||||
std::is_same<std::string, std::remove_cv_t<T>>::value,
|
std::is_same<std::string, std::remove_cv_t<T>>::value,
|
||||||
std::nullptr_t> = nullptr>
|
std::nullptr_t> = nullptr>
|
||||||
#else
|
#else
|
||||||
template<typename T>
|
template<typename T>
|
||||||
#endif
|
#endif
|
||||||
|
@ -144,9 +144,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __DOXYGEN__
|
#ifndef __DOXYGEN__
|
||||||
template<typename T, typename std::enable_if_t<!details::is_span<T>::value &&
|
template<typename T, std::enable_if_t<!details::is_span<T>::value &&
|
||||||
!std::is_same<std::string, std::remove_cv_t<T>>::value,
|
!std::is_same<std::string, std::remove_cv_t<T>>::value,
|
||||||
std::nullptr_t> = nullptr>
|
std::nullptr_t> = nullptr>
|
||||||
T get() const
|
T get() const
|
||||||
{
|
{
|
||||||
assert(type_ == details::control_type<std::remove_cv_t<T>>::value);
|
assert(type_ == details::control_type<std::remove_cv_t<T>>::value);
|
||||||
|
@ -155,9 +155,9 @@ public:
|
||||||
return *reinterpret_cast<const T *>(data().data());
|
return *reinterpret_cast<const T *>(data().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename std::enable_if_t<details::is_span<T>::value ||
|
template<typename T, std::enable_if_t<details::is_span<T>::value ||
|
||||||
std::is_same<std::string, std::remove_cv_t<T>>::value,
|
std::is_same<std::string, std::remove_cv_t<T>>::value,
|
||||||
std::nullptr_t> = nullptr>
|
std::nullptr_t> = nullptr>
|
||||||
#else
|
#else
|
||||||
template<typename T>
|
template<typename T>
|
||||||
#endif
|
#endif
|
||||||
|
@ -172,18 +172,18 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __DOXYGEN__
|
#ifndef __DOXYGEN__
|
||||||
template<typename T, typename std::enable_if_t<!details::is_span<T>::value &&
|
template<typename T, std::enable_if_t<!details::is_span<T>::value &&
|
||||||
!std::is_same<std::string, std::remove_cv_t<T>>::value,
|
!std::is_same<std::string, std::remove_cv_t<T>>::value,
|
||||||
std::nullptr_t> = nullptr>
|
std::nullptr_t> = nullptr>
|
||||||
void set(const T &value)
|
void set(const T &value)
|
||||||
{
|
{
|
||||||
set(details::control_type<std::remove_cv_t<T>>::value, false,
|
set(details::control_type<std::remove_cv_t<T>>::value, false,
|
||||||
reinterpret_cast<const void *>(&value), 1, sizeof(T));
|
reinterpret_cast<const void *>(&value), 1, sizeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename std::enable_if_t<details::is_span<T>::value ||
|
template<typename T, std::enable_if_t<details::is_span<T>::value ||
|
||||||
std::is_same<std::string, std::remove_cv_t<T>>::value,
|
std::is_same<std::string, std::remove_cv_t<T>>::value,
|
||||||
std::nullptr_t> = nullptr>
|
std::nullptr_t> = nullptr>
|
||||||
#else
|
#else
|
||||||
template<typename T>
|
template<typename T>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -32,7 +32,7 @@ LOG_DECLARE_CATEGORY(IPADataSerializer)
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
template<typename T,
|
template<typename T,
|
||||||
typename std::enable_if_t<std::is_arithmetic_v<T>> * = nullptr>
|
std::enable_if_t<std::is_arithmetic_v<T>> * = nullptr>
|
||||||
void appendPOD(std::vector<uint8_t> &vec, T val)
|
void appendPOD(std::vector<uint8_t> &vec, T val)
|
||||||
{
|
{
|
||||||
constexpr size_t byteWidth = sizeof(val);
|
constexpr size_t byteWidth = sizeof(val);
|
||||||
|
|
|
@ -163,7 +163,7 @@ public:
|
||||||
|
|
||||||
#ifndef __DOXYGEN__
|
#ifndef __DOXYGEN__
|
||||||
template<typename T,
|
template<typename T,
|
||||||
typename std::enable_if_t<
|
std::enable_if_t<
|
||||||
std::is_same_v<bool, T> ||
|
std::is_same_v<bool, T> ||
|
||||||
std::is_same_v<double, T> ||
|
std::is_same_v<double, T> ||
|
||||||
std::is_same_v<int16_t, T> ||
|
std::is_same_v<int16_t, T> ||
|
||||||
|
@ -185,7 +185,7 @@ public:
|
||||||
|
|
||||||
#ifndef __DOXYGEN__
|
#ifndef __DOXYGEN__
|
||||||
template<typename T,
|
template<typename T,
|
||||||
typename std::enable_if_t<
|
std::enable_if_t<
|
||||||
std::is_same_v<bool, T> ||
|
std::is_same_v<bool, T> ||
|
||||||
std::is_same_v<double, T> ||
|
std::is_same_v<double, T> ||
|
||||||
std::is_same_v<int16_t, T> ||
|
std::is_same_v<int16_t, T> ||
|
||||||
|
|
|
@ -307,7 +307,7 @@ std::optional<Size> YamlObject::get() const
|
||||||
#ifndef __DOXYGEN__
|
#ifndef __DOXYGEN__
|
||||||
|
|
||||||
template<typename T,
|
template<typename T,
|
||||||
typename std::enable_if_t<
|
std::enable_if_t<
|
||||||
std::is_same_v<bool, T> ||
|
std::is_same_v<bool, T> ||
|
||||||
std::is_same_v<double, T> ||
|
std::is_same_v<double, T> ||
|
||||||
std::is_same_v<int16_t, T> ||
|
std::is_same_v<int16_t, T> ||
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue