libcamera: Use helper variable template for type traits

C++17 introduces helper variable templates for type traits, allowing
shortening std::is_foo<T>::value to std::is_foo_v<T>. Use them through
the code base.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart 2020-10-26 21:15:11 +02:00
parent 7adf3a0698
commit 6cbdc28599
5 changed files with 34 additions and 34 deletions

View file

@ -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<std::string, std::remove_cv_t<T>>::value,
!std::is_same_v<std::string, std::remove_cv_t<T>>,
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<std::string, std::remove_cv_t<T>>::value,
std::is_same_v<std::string, std::remove_cv_t<T>>,
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<std::string, std::remove_cv_t<T>>::value,
!std::is_same_v<std::string, std::remove_cv_t<T>>,
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<std::string, std::remove_cv_t<T>>::value,
std::is_same_v<std::string, std::remove_cv_t<T>>,
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<std::string, std::remove_cv_t<T>>::value,
!std::is_same_v<std::string, std::remove_cv_t<T>>,
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<std::string, std::remove_cv_t<T>>::value,
std::is_same_v<std::string, std::remove_cv_t<T>>,
std::nullptr_t> = nullptr>
#else
template<typename T>