Skip to content
New issue

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

[error] index_of #338

Open
Jacyking opened this issue Dec 8, 2024 · 2 comments
Open

[error] index_of #338

Jacyking opened this issue Dec 8, 2024 · 2 comments

Comments

@Jacyking
Copy link
Contributor

Jacyking commented Dec 8, 2024

std::cout << ylt::reflection::index_of<&person::age>() << "\n";
std::cout << ylt::reflection::index_of<&person::name>() << "\n";

expect output
1
0

@Jacyking Jacyking changed the title index_of error [error] index_of Dec 9, 2024
@qicosmos
Copy link
Owner

qicosmos commented Dec 9, 2024

你这个测试代码搞完整一点,person对象是怎么定义的,index的结果哪里不符合预期都写一下。

@Jacyking
Copy link
Contributor Author

Jacyking commented Dec 9, 2024

你这个测试代码搞完整一点,person对象是怎么定义的,index的结果哪里不符合预期都写一下。

struct person {
std::string name;
int age;
};
YLT_REFL(person, name, age)

msvc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants