C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Proposing Mixed Template Parameter Packs [initial discussion]

From: Barry Revzin <barry.revzin_at_[hidden]>
Date: Fri, 18 Feb 2022 15:54:21 -0600
See P1985, which uses "template auto T" as a template paramater of
arbitrary kind. I wish there was a good non-auto-related syntax for this,
but I have no idea what that would be and this one is certainly sensible.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1985r1.pdf

Barry

On Fri, Feb 18, 2022, 2:56 PM mail--- via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> Dear all,
>
> I have been running into limitations with respect to template parameters,
> which prevents me from writing some general-purpose helpers (e.g., for use
> in ensuring type safety and in template meta-programming). To address these
> limitations, I have worked out a small proposal for the addition of ``mixed
> template parameter packs'' to the language.
>
> I have attached an initial draft of this feature and I welcome any input
> (e.g., whether there is demand for the feature and any comments) before I
> pursue further formalization of this feature and proposing it for inclusion
> in the standard.
>
> Below is the abstract of my proposal:
> We propose the addition of mixed template parameter packs as an option for
> parameter lists in template declarations. These mixed template parameter
> packs represent zero-or-more template parameters of unknown kinds and can
> represent any combination of type, non-type, and template template
> parameters.
>
> The motivating use case for mixed template parameter packs is the
> definition
> of general-purpose concepts that hold only for a given class template X,
> this independent of the kind of template parameters X requires.
> Furthermore,
> we show that mixed template parameter packs provide a general-purpose
> strengthening of the already-excellent template meta-programming facilities
> provided by C++.
>
> With kind regards,
> Jelle Hellings
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2022-02-18 21:54:35