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
@kris-jusiak again a very superb library. Kudos 👍
What would it take to enable support for inherited classes and CTRPs (see compiler-explorer example):
#include <https://raw.githubusercontent.com/boost-ext/reflect/main/reflect> #include <print> #include <string> #include <string_view> #include <type_traits> template <typename Derived> struct Base { float d = 3.141f; }; template<typename T> struct Test : public Base<Test<T>> { T a = 42; float b = 43.f; std::string c = "Hello World!"; }; int main() { Test<int> s{}; reflect::for_each([&](auto I) { const auto value = reflect::get<I>(s); constexpr std::string_view class_name(reflect::type_name(s)); constexpr std::string_view name = reflect::member_name<I>(s); constexpr std::string_view type_name = reflect::type_name(reflect::get<I>(s)); std::print("reflect: {}.{} {} = {}\n", class_name, type_name, name, value); }, s); }
Keep up the good work!
The text was updated successfully, but these errors were encountered:
Thanks.
The inheritance is a bit tricky but I think it's possible to a certain degree at least.
Not sure, whether can be done with structure bindings, though 🤔 which is used for the member names reflection, is not required for member values.
https://godbolt.org/z/4n61vMaj4
Will give it a go, though.
Sorry, something went wrong.
No branches or pull requests
@kris-jusiak again a very superb library. Kudos 👍
What would it take to enable support for inherited classes and CTRPs (see compiler-explorer example):
Keep up the good work!
The text was updated successfully, but these errors were encountered: