Skip to content

Possibly misleading sentence in [temp.spec]/5 #1860

@cpplearner

Description

@cpplearner

[temp.spec]/5:

For a given template and a given set of template-arguments,

  • [...]
  • an explicit specialization shall be defined at most once in a program (according to [basic.def.odr]),
  • [...]

I think it intends to say that an explicit specialization follows the requirements and exceptions (no pun intended) of the one-definition rule. In particular, specializations that define classes/inline functions/inline variables need to be present in every translation units that uses them. (Otherwise I cannot imagine how std::char_traits<char> or std::future<void> can be implemented.) But the wording does not make that clear.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions