TheNitesWhoSay / RareCpp

Creating a simpler, more intuitive means of C++ reflection
MIT License
122 stars 6 forks source link

Increase Constexpr #87

Closed TheNitesWhoSay closed 1 year ago

TheNitesWhoSay commented 2 years ago

Perform further exploration on whether the ForEachField/FieldAt methods which operate on an instance of the reflected class can be made constexpr, at a glance MSVC compiler has no issue, though intellisense has a few; Clang has an issue with use of ObjectMapper prior to the REFLECT macro (e.g. if you wrote a copy constructor using ObjectMapper before you wrote the REFLECT macro, that errors out on the constexpr methods, whereas it didn't when they were non-constexpr).

I came across a compile-time serialization use-case today, and I was able to use the non-instanced overloads just fine, but ForEachField would have been better.

TheNitesWhoSay commented 1 year ago

Constexpr field access has good support as of release 2.0.0.