diff -r c229d38f04c6 -r 91053052bb28 src/basics.h --- a/src/basics.h Sat Apr 08 16:12:12 2023 +0300 +++ b/src/basics.h Sat Apr 08 16:41:40 2023 +0300 @@ -345,3 +345,14 @@ { return Message{.time = QDateTime::currentDateTime(), .type = Message::Error, .text = text}; } + +template +struct MemberData +{ + std::size_t member; + DataType payload; + constexpr MemberType memberInstance(BaseType* instance) const + { + return *reinterpret_cast(reinterpret_cast(instance) + this->member); + } +};