Generating Operator Functions
cppdashboard.dev/r/2026/10/generating-operator-functionsThis article discusses the generation of operator functions in C++, exploring the differences between push and pull mechanisms. It provides insights into how these functions can be effectively implemented.
From the article
In a previous post , I discussed the differences between push-based and pull-based customization in the context of trying to implement support for formatting and structured bindings. For those problems, pull-based customization (adding an annotation to a type and having a partial class template specialization that looks for that annotation) works pretty well — until you suddenly run into ambiguities. So in some cases, you really want to inject an explicit specialization instead — which works until the you need to check the customization point before you actually instantiate the class. At that point, want to inject a partial specialization that matches the class template shape.
In P4380R0 , I showed an example that does full declaration cloning, so we can do the right thing for all class…
Share this resource