C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Generic code, not the API you are looking for

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Fri, 19 Aug 2022 11:40:07 -0400
Your suggestion seems predicated on the idea that customization points
are something we're supposed to be using all the time.

They aren't.

They're a specific tool that fixes a specific problem. You have some
template API that needs to access some functionality of a type.
However, it would be really handy if 3rd party types could be made to
fulfill that API without having to modify those types (and/or can work
on basic types, since they cannot be extended at all). This is what
customization points (and type traits) deal with.

They're not supposed to be a default "always do this unless otherwise
stated" thing. They're not something you do all, most, or even much of
the time. They are a specific tool to fix a specific problem.

"Generic code is normal code" is meant to be about making generic
programming easier for the user. It is not meant to say that you need
to do everything with customization points.

So while I would love a language-based technique for making
customization points, your reasoning isn't a good rationale for it.

Received on 2022-08-19 15:40:30