AK: Add OFFSET_OF macro that works on class member fields

This commit is contained in:
Andreas Kling 2023-11-06 15:18:15 +01:00
parent 24d5070520
commit af5fd99ff4
Notes: sideshowbarker 2024-07-16 23:05:02 +09:00

View file

@ -16,6 +16,8 @@
#include <AK/Assertions.h>
#define OFFSET_OF(class, member) (reinterpret_cast<ptrdiff_t>(&reinterpret_cast<class*>(0x1000)->member) - 0x1000)
namespace AK {
template<typename T, typename U>