RossBrunton wrote: My preference in that case would still be macros, but I've not looked into this so if you have a template solution that is cleaner I'm happy with that. https://github.com/llvm/llvm-project/pull/151714