Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Deduction Guide have an explicit(bool) specifier?

Multiple parts of the standard indicate that deduction guide cannot have an explicit-specifier but can only have an explicit keyword preceding it.

like:

in temp.deduct.duide

deduction-guide:

explicitopttemplate-name ( parameter-declaration-clause ) -> simple-template-id ;

note that the standard says : explicitopt and not explicit-specifier.

or in dcl.fct.spec

An explicit-specifier shall be used only in the declaration of a constructor or conversion function within its class definition; ...

but the standard also says in over.match.class.deduct

If the function or function template was generated from a constructor or deduction-guide that had an explicit-specifier, each such notional constructor is considered to have that same explicit-specifier.

this quote implies that deduction-guides can have an explicit-specifier.

I do not see any particular reason why deduction guide couldn't have a explicit-specifier.

Is the issue in my understanding of the standard or in the standard itself ?

Can Deduction Guide have an explicit(bool) specifier ?

like image 411
Tyker Avatar asked Apr 22 '19 13:04

Tyker


1 Answers

I do not see any particular reason why deduction guide couldn't have a explicit-specifier.

Me neither. Seems like a total oversight on my part (I'm one of the authors of conditional explicit). I'll try to file a core issue.

Update: This was fixed in P1968, adopted in Belfast, as part of the resolution for core issue 2422.

like image 181
Barry Avatar answered Oct 17 '22 23:10

Barry