pfr
pfr copied to clipboard
boost::pfr::names_as_array<T> does not work on structure include c array
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>();
}
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