util/Cast: suppress "unused function" warning by using "inline"
This commit is contained in:
parent
e74e1256d4
commit
393cb7fd7d
|
@ -35,14 +35,14 @@
|
||||||
/**
|
/**
|
||||||
* Offset the given pointer by the specified number of bytes.
|
* Offset the given pointer by the specified number of bytes.
|
||||||
*/
|
*/
|
||||||
static constexpr void *
|
static inline constexpr void *
|
||||||
OffsetPointer(void *p, ptrdiff_t offset)
|
OffsetPointer(void *p, ptrdiff_t offset)
|
||||||
{
|
{
|
||||||
return (char *)p + offset;
|
return (char *)p + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename U>
|
template<typename T, typename U>
|
||||||
static constexpr T *
|
static inline constexpr T *
|
||||||
OffsetCast(U *p, ptrdiff_t offset)
|
OffsetCast(U *p, ptrdiff_t offset)
|
||||||
{
|
{
|
||||||
return reinterpret_cast<T *>(OffsetPointer(p, offset));
|
return reinterpret_cast<T *>(OffsetPointer(p, offset));
|
||||||
|
|
Loading…
Reference in New Issue