0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-23 22:13:55 +01:00

ircd::util: Add is_pod wrapper; fix deprecation warning.

This commit is contained in:
Jason Volk 2022-06-23 18:43:18 -07:00
parent bcbcfba6e8
commit 7f2ac27cc5
2 changed files with 9 additions and 2 deletions

View file

@ -240,6 +240,13 @@ is_integer()
return is_number<T>() && !is_floating<T>();
}
template<class T>
constexpr bool
is_pod()
{
return std::is_standard_layout<T>::value && std::is_trivial<T>::value;
}
//
// Convenience constexprs for iterators
//

View file

@ -129,7 +129,7 @@ noexcept
}
template<class T>
constexpr typename std::enable_if<std::is_pod<T>::value, const uint8_t *>::type
constexpr typename std::enable_if<is_pod<T>(), const uint8_t *>::type
data(const T &val)
noexcept
{
@ -137,7 +137,7 @@ noexcept
}
template<class T>
constexpr typename std::enable_if<std::is_pod<T>::value, uint8_t *>::type
constexpr typename std::enable_if<is_pod<T>(), uint8_t *>::type
data(T &val)
noexcept
{