Herb Sutter mentioned that Jetbrains might have a compile time debugger. That would be handy since we're pushing a lot of values around at compile time now.
You can also move from reflection to metaprogramming pretty seamlessly too, so you can define some templated functions somewhere and recursively call those functions on all the members of a class and all the members of its base classes if you want to. Which is handy if you want to, say, define generic load/save functions for Cereal, for example.
It looks kind of nasty but since those are all just compile time templates and reflection data, the compiler just unwinds all the stuff at compile time and then evaporates at run time.
That really does get rid of all the cereal boilerplate too. I think the best "nothing up my sleeve" test in there is the to/from functions test for XML and JSON that just do the right thing on a test struct. It can handle private members too, of course, but you would need to friend the cereal access class to do that. Some of the other tests in the test directory do that. I need to update the comment on the private serialization test, as that was fixed a week or so ago by a gcc16 update.
View all comments
Show parent comment
2
u/FlyingRhenquest Feb 19 '26
Herb Sutter mentioned that Jetbrains might have a compile time debugger. That would be handy since we're pushing a lot of values around at compile time now.
You can also move from reflection to metaprogramming pretty seamlessly too, so you can define some templated functions somewhere and recursively call those functions on all the members of a class and all the members of its base classes if you want to. Which is handy if you want to, say, define generic load/save functions for Cereal, for example.
It looks kind of nasty but since those are all just compile time templates and reflection data, the compiler just unwinds all the stuff at compile time and then evaporates at run time.
That really does get rid of all the cereal boilerplate too. I think the best "nothing up my sleeve" test in there is the to/from functions test for XML and JSON that just do the right thing on a test struct. It can handle private members too, of course, but you would need to friend the cereal access class to do that. Some of the other tests in the test directory do that. I need to update the comment on the private serialization test, as that was fixed a week or so ago by a gcc16 update.