Open Linhuihang opened 1 year ago
``
struct MyStruct { MyStruct() {}; int data[3]; };
RTTR_REGISTRATION { using namespace rttr;
// 注册一个普通的函数
registration::class_
int main() { return 0; } ``
#include <rttr/registration>
struct MyStruct { MyStruct() {}; int data[3]; };
RTTR_REGISTRATION
{
using namespace rttr;
// 注册一个普通的函数
registration::class_<MyStruct>("MyStruct")
.constructor<>()
.property("data", &MyStruct::data);
}
int main() {
return 0;
}
`#include <rttr/registration>
struct MyStruct { MyStruct() {}; int data[3]; };
RTTR_REGISTRATION { using namespace rttr;
// 注册一个普通的函数 registration::class_("MyStruct")
.constructor<>()
.property("data", &MyStruct::data);
}
int main() { return 0; }`