Closed GregTheMadMonk closed 8 months ago
Interesting. The only possible explanation I have is that you put rfl/json.hpp before rfl.hpp. But I agree, it shouldn’t be necessary.
Thanks for the issue. I will take a look.
I also noticed this using clangd
on my machine. It seems the tests compile fine because they all include stuff previously, but I would expect everything to be internally consistent too. I have an idea to check for consistency with a Github Actions check: try compile every single header on its own and see if it breaks or not. clang-tidy
might also be an option, I'll check.
By the way, here is what happened: As suspected, the issue was resolved once you change the include order of rfl.hpp and rfl/json.hpp.
I use clang-format which does that for me automatically. I agree with @ChemiCalChems ...something like clang-tidy would be a good idea to avoid this in the future.
Anyway, @GregTheMadMonk , thanks for the issue.
My example program and compile log (reflect-cpp is cloned from main):