We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
struct PV_RANGE_INT { int32_t nMin = 0; int32_t nMax = 0; }; RTTR_REGISTRATION { rttr::registration::class_<PV_RANGE_INT>("PV_RANGE_INT") .constructor<>() .property("nMin", &PV_RANGE_INT::nMin) .property("nMax", &PV_RANGE_INT::nMax); } int main(int argc, char *argv[]) { rttr::type type = rttr::type::get_by_name("PV_RANGE_INT"); if (type.is_valid()) { rttr::variant range = type.create(); type.set_property_value("nMin", range, 10); type.set_property_value("nMax", range, 20); rttr::property property_nMin = type.get_property("nMin"); if (property_nMin.is_valid()) { property_nMin.get_value(range).get_value<PV_RANGE_INT>().nMin; } rttr::property property_nMax = type.get_property("nMax"); if (property_nMax.is_valid()) { property_nMax.get_value(range).get_value<PV_RANGE_INT>().nMax; } int32_t min_value = range.get_value<PV_RANGE_INT>().nMin; int32_t max_value = range.get_value<PV_RANGE_INT>().nMax; std::cout << "nMin: " << min_value << std::endl; std::cout << "nMax: " << max_value << std::endl; } return 0; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: