Closed huangqinjin closed 8 months ago
Thanks for opening this. The current system is definitely in need of work. It used to be implemented with a long if-constexpr chain and I think you’re right that it may be time to move back to that.
I'm going to close this, happy to discuss improvements further. I think there is likely still room for improvement.
There are several problems in current implementation, e.g., not allow to override default stringification, customization on enum and pointer does not work.
The above code outputs
Current stringification relies on complicated and verbose and error-prone SFINAE. Since we are using C++17 now,
if constexpr
can reduce the use of SFINAE.