Commit fec80f28 authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

util/Cast: use std::ptrdiff_t

parent 4e47653c
......@@ -37,27 +37,27 @@
template<typename T, typename U>
constexpr T *
OffsetCast(U *p, ptrdiff_t offset)
OffsetCast(U *p, std::ptrdiff_t offset)
{
return reinterpret_cast<T *>(OffsetPointer(p, offset));
}
template<typename T, typename U>
constexpr T *
OffsetCast(const U *p, ptrdiff_t offset)
OffsetCast(const U *p, std::ptrdiff_t offset)
{
return reinterpret_cast<const T *>(OffsetPointer(p, offset));
}
template<class C, class A>
constexpr ptrdiff_t
constexpr std::ptrdiff_t
ContainerAttributeOffset(const C *null_c, const A C::*p)
{
return ptrdiff_t((const char *)&(null_c->*p) - (const char *)null_c);
return std::ptrdiff_t((const char *)&(null_c->*p) - (const char *)null_c);
}
template<class C, class A>
constexpr ptrdiff_t
constexpr std::ptrdiff_t
ContainerAttributeOffset(const A C::*p)
{
return ContainerAttributeOffset<C, A>(nullptr, p);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment