On Wed, 6 Feb 2019 at 12:21, Ville Voutilainen <ville.voutilai...@gmail.com> wrote: > > I think the assumption was this would produce smaller code. Does that > > hold true? > > I think the assumption was that this produces equivalent or better > code than fixing the current > semantics bugs with some sort of separate constexpr arrays of function > pointers would. > And certainly better code than any approach that has a run-time > branch. I don't think this ends up > being different from the current codegen; both have an array indexing > operation followed by an indirect > function call.
And, to emphasize, the most important reason for this was to be able to write straightforward code for the special member functions, with the hope that it wouldn't have a negative codegen effect. Our Microsoft friends described the general technique as "has crazy-good codegen", but I have no idea what their starting point was; our starting point probably wasn't bad to begin with.