I've developed a style that I legitimately call Heterodox C++ (mainly due to the popularity of Orthodox C++), it is effectively a purely functional & metaprogramming heavy style of C++. Quite the opposite of this, not everyones cup of tea, and it won't fit into every codebase but it is incredibly powerful. The template metaprogramming C++ offers is the most powerful of any imperative language, and (subjective opinion) is second only to Lisp, but few people make use of it. With some of C++26 features you can almost even replicate most of Rusts safety features in pure C++ (via function tagging + reflection)
> The template metaprogramming C++ offers is the most powerful of any imperative language
I'm curious what languages you're comparing to here. Feels like it's only slightly more expressive than pure generics, but I admittedly haven't done much template metaprogramming myself. How does it compare to, say, Zig's comptime?
The problem with metaprogramming-heavy C++ codebases is always compilation times and obtuse error messages...
Template metaprogramming is sometimes very useful to get around C++'s language restrictions, but I tend to use it sparingly.
> obtuse error messages
With concepts and constexpr-if and consteval it's increasingly less of a problem
have you written about this anywhere, or hosting any examples?
You might find Functional Programming in C++ by Ivan Cukic relevant.
Not yet, I might one day.
C++ template metaprogramming is in some ways more powerful than Common Lisp macros, because it works at the type level: you can generate new types and dispatch into separate implementations by type. In contrast, Common Lisp type declarations are not available at macro expansion time unless you implement a full source-to-source translator in macros.