Article

Generating Operator Functions

Barry ·Barry's C++ Blog ·Published 2026-10-14 ·5 min read

This 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


Discovered 2026-10-15 Source Barry's C++ Blog Archive 2026-10 →