Subject: Re: Partial ordering of function template which have a place holder for deduced class type in the template parameter list.
From: Olivier Kannengieser (okannen_at_[hidden])
Date: 2020-08-05 05:22:39
I made some search, placeholder for deduced class type in non type template
parameter was added by the merge of P0732R2
this feature not supposed to be merged in the standard?
Le mar. 4 aoÃ»t 2020 Ã 21:34, Olivier Kannengieser <okannen_at_[hidden]> a
> The paragraph that allowes place holder for deduced class type in template
> parameter is [dcl.type.class.deduc]/Â§2
> >A placeholder for a deduced class type can also be used in the
> type-specifier-seq <http://eel.is/c++draft/dcl.type#nt:type-specifier-seq> in
> the new-type-id <http://eel.is/c++draft/expr.new#nt:new-type-id> or
> type-id <http://eel.is/c++draft/dcl.name#nt:type-id> of a new-expression
> <http://eel.is/c++draft/expr.new#nt:new-expression>, as the
> <http://eel.is/c++draft/dcl.type.simple#nt:simple-type-specifier> in an explicit
> type conversion (functional notation)
> <http://eel.is/c++draft/expr.type.conv>, or as the type-specifier
> <http://eel.is/c++draft/dcl.type#nt:type-specifier> in the
> <http://eel.is/c++draft/dcl.fct#nt:parameter-declaration> of a
> I had not read non normative "Notes", and apparently the behavior seems to
> be recognize by the standard [temp.func.order]/Â§3
> [Note <http://eel.is/c++draft/temp.func.order#3.note-1>:
> The type replacing the placeholder in the type of the value synthesized
> for a non-type template parameter is also a unique synthesized type.
> â *end note*]
> This is a frustrating limitation because at least it makes impossible to
> partially specialize any class template with a non-type template parameter
> that uses a placeholder for deduced class type. Should not this be changed?
> Le lun. 3 aoÃ»t 2020 Ã 00:44, Ville Voutilainen via Std-Discussion <
> std-discussion_at_[hidden]> a Ã©crit :
>> On Mon, 3 Aug 2020 at 01:33, Jason McKesson via Std-Discussion
>> <std-discussion_at_[hidden]> wrote:
>> > On Sun, Aug 2, 2020 at 2:30 PM Olivier Kannengieser via Std-Discussion
>> > <std-discussion_at_[hidden]> wrote:
>> > >
>> > > No this is what I meant. 'A x' is a C++20 feature: place holder for
>> deduced class type for the declaration of non type template parameter.
>> > No, "place holder for deduced class type for the declaration of non
>> > type template parameter" is the C++17 feature that allows `auto x` to
>> > work in template arguments. A template name by itself is not a
>> > placeholder.
>> > C++20 allows `ConceptName auto x`, which does the above except with a
>> > concept constraint as to `x`'s type.
>> > At no point does C++ permit `TemplateName x` to work in a template
>> > parameter list. There were some Concept ideas that `TemplateName<auto>
>> > x` might work, and maybe Concepts TS allowed you to drop the argument.
>> > But C++20 does not.
>> I'm not sure what you mean by "TemplateName x", but this certainly does
>> template <class T> concept foo = /* whatever */;
>> template <foo T> void f(); // or struct, class, etc.
>> That foo is probably not what you mean by TemplateName, because it's a
>> Std-Discussion mailing list
STD-DISCUSSION list run by email@example.com
Older Archives on Google Groups