C++ Logo

std-proposals

Advanced search

[std-proposals] Avoiding code duplication for template specializations

From: Leo Riesenbach <leoriesenbach_at_[hidden]>
Date: Fri, 17 Nov 2023 21:13:41 -0500
Hello,

I stumbled upon N3596: Code Reuse in Class Template Specialization
recently, and it seems like it fixes a lot of pain points in the generic
library I've been working on. I see template specialization as one of the
most powerful avenues (and potentially the prettiest avenue) we have for
passing custom functionality through generic interfaces, but it's always
been hindered by the necessity to repeat all of the code from the
unspecialized template.

N3596 doesn't seem to have gone anywhere, but I'm curious if there's been
any other discussion about this topic of making template specialization
less reliant on code duplication. Are there technical reasons that this
idea doesn't work? Or has there just been a lack of motivation and effort
on pushing this through as a feature? Would you be interested in this
feature?

Thanks,
Leo Riesenbach

Received on 2023-11-18 02:14:00