Tyker
Tyker

Reputation: 3047

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:

explicitopt template-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 ?

Upvotes: 33

Views: 820

Answers (1)

Barry
Barry

Reputation: 303307

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.

Upvotes: 35

Related Questions