util/Cast: use std::ptrdiff_t
This commit is contained in:
parent
4e47653cf6
commit
fec80f2835
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue