boostorg / pfr

std::tuple like methods for user defined types without any macro or boilerplate code
https://boost.org/libs/pfr
Boost Software License 1.0
1.34k stars 161 forks source link

Add `index` variable template to get index of member pointer #176

Open uyha opened 3 months ago

uyha commented 3 months ago

closes #60

uyha commented 3 months ago

@apolukhin I could not find the document on how to contribute, could you direct me on the following matters?

apolukhin commented 2 months ago

How to run the tests locally? How do I add test?

cd boost/libs/pfr/tests
../../../b2 cxxstd=17

I use requires in the implementation, should I drop to SFINAE to support C++17?

Yes, please

There is a case that the index cannot be found, what should I do there?

How about returning std::optional ? Or you could throw an exception. Or return -1. Write some samples and experiment to get the idea of which error reporting mechanic is better for that function.