> I very much hope that the attribute will catch on, spreading to GCC, Visual C++, and other popular compilers,
AFAIK, attribute musttail is in the process of being added to GCC (the patch is under review) with semantics compatible with clang.
AFAIK, attribute musttail is in the process of being added to GCC (the patch is under review) with semantics compatible with clang.
In the meantime some inline assembly macro trickery might help.
edit: code duplication can also be obviated by templating your op function with a fast/slow parameter, with the fast variant tail-calling the slow variant when it cannot perform the fast path, while guarding the slow code via the compile time parameter. The downside is yet more code obfuscation of course.
What's realistic here is that you get a diagnostic if the compiler cannot generate a tail call. For many users, that will likely be good enough. Guaranteeing a tail call as in Scheme is unlikely to happen.