diff --git a/src/util/Cast.hxx b/src/util/Cast.hxx index 21075f1ce..05871df64 100644 --- a/src/util/Cast.hxx +++ b/src/util/Cast.hxx @@ -36,28 +36,28 @@ #include template -static inline constexpr T * +constexpr T * OffsetCast(U *p, ptrdiff_t offset) { return reinterpret_cast(OffsetPointer(p, offset)); } template -static inline constexpr T * +constexpr T * OffsetCast(const U *p, ptrdiff_t offset) { return reinterpret_cast(OffsetPointer(p, offset)); } template -static constexpr inline ptrdiff_t +constexpr ptrdiff_t ContainerAttributeOffset(const C *null_c, const A C::*p) { return ptrdiff_t((const char *)&(null_c->*p) - (const char *)null_c); } template -static constexpr inline ptrdiff_t +constexpr ptrdiff_t ContainerAttributeOffset(const A C::*p) { return ContainerAttributeOffset(nullptr, p); @@ -67,7 +67,7 @@ ContainerAttributeOffset(const A C::*p) * Cast the given pointer to a struct member to its parent structure. */ template -static inline constexpr C & +constexpr C & ContainerCast(A &a, const A C::*member) { return *OffsetCast(&a, -ContainerAttributeOffset(member)); @@ -77,7 +77,7 @@ ContainerCast(A &a, const A C::*member) * Cast the given pointer to a struct member to its parent structure. */ template -static inline constexpr const C & +constexpr const C & ContainerCast(const A &a, const A C::*member) { return *OffsetCast(&a, -ContainerAttributeOffset(member));