演绎指南可以有一个明确的(bool)说明符吗?
Can Deduction Guide have an explicit(bool) specifier?
标准的多个部分表明演绎指南不能有explicit-specifier,只能有一个明确的关键字。
赞:
deduction-guide:
explicitopt template-name ( parameter-declaration-clause ) -> simple-template-id ;
请注意,标准说:explicitopt 而不是 explicit-specifier.
An explicit-specifier shall be used only in the declaration of a constructor or conversion function within its class definition; ...
中也有说明
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.
这句话暗示演绎指南可以有一个 explicit-specifier。
我看不出演绎指南没有 explicit-specifier 的任何特殊原因。
是我对标准的理解有问题还是标准本身有问题?
演绎指南可以有一个 explicit(bool) 说明符吗?
I do not see any particular reason why deduction guide couldn't have a explicit-specifier.
我也没有。似乎完全是我的疏忽(我是 conditional explicit
的作者之一)。我将尝试提出一个核心问题。
更新: 这已在 P1968 中修复,在贝尔法斯特通过,作为核心问题 2422 决议的一部分。
标准的多个部分表明演绎指南不能有explicit-specifier,只能有一个明确的关键字。
赞:
deduction-guide:
explicitopt template-name ( parameter-declaration-clause ) -> simple-template-id ;
请注意,标准说:explicitopt 而不是 explicit-specifier.
中也有说明An explicit-specifier shall be used only in the declaration of a constructor or conversion function within its class definition; ...
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.
这句话暗示演绎指南可以有一个 explicit-specifier。
我看不出演绎指南没有 explicit-specifier 的任何特殊原因。
是我对标准的理解有问题还是标准本身有问题?
演绎指南可以有一个 explicit(bool) 说明符吗?
I do not see any particular reason why deduction guide couldn't have a explicit-specifier.
我也没有。似乎完全是我的疏忽(我是 conditional explicit
的作者之一)。我将尝试提出一个核心问题。
更新: 这已在 P1968 中修复,在贝尔法斯特通过,作为核心问题 2422 决议的一部分。