#pragma once #include template struct False { static constexpr auto value = false; }; template struct MemberIsOffsetBy { static_assert(False::value, "Member is offset by this value (Difference, Expected, Current, Class, Member)"); }; template struct SizeIsOffsetBy { static_assert(False::value, "Size is offset by this value (Difference, Expected, Current, Class)"); }; template struct MemberIsOffsetBy { }; template struct SizeIsOffsetBy { }; template struct SingleMemberChecker { using IsOffsetBy = MemberIsOffsetBy; }; template struct SingleSizeChecker { using IsOffsetBy = SizeIsOffsetBy; }; #define GEODE_MEMBER_CHECK(Class_, Member_, Offset_) class Member_; SingleMemberChecker::IsOffsetBy GEODE_CONCAT(OffsetBy, __LINE__) #define GEODE_SIZE_CHECK(Class_, Offset_) SingleSizeChecker::IsOffsetBy GEODE_CONCAT(OffsetBy, __LINE__)