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

boost::pfr::names_as_array<T> does not work on structure include c array #162

Open
baker-Xie opened this issue Feb 23, 2024 · 1 comment

Comments

@baker-Xie
Copy link

demo code like this

#include "boost/pfr.hpp"

struct some_person {
    float data[3];
};

int main(int argc, const char* argv[]) {
    auto name = boost::pfr::names_as_array<some_person>();
}
@XRay3D
Copy link

XRay3D commented May 16, 2024

Incorrectly defines structures with nested arrays. If the arrays are length of 1, then everything works correctly.

struct {
    float arr1[3]{};
    float arr2[3]{};
} array1;
float array2[3][2]{};

qWarning() << pfr::tuple_size_v<decltype(array1)>; // 6
qWarning() << pfr::tuple_size_v<decltype(array2)>; // 6

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