C++ Logo


Advanced search

Define "instantiate".

From: Andrew Schepler <aschepler_at_[hidden]>
Date: Sun, 25 Apr 2021 09:11:36 -0400
The Standard says a lot of things about instantiating templates, but it
seems to me to miss out on saying essentially what it actually means. The
closest is at the start of [temp.spec]

> The act of instantiating a function, a variable, a class, a member of a
> class template, or a member template is referred to as *template
> instantiation*
> <https://timsong-cpp.github.io/cppwp/temp.spec#def:template_instantiation>
> .

I think it could be good to add immediately before or after that something

Instantiating a *template-declaration* with a given list of template
arguments transforms the contained *declaration *into a declaration for a
specialization of the template, in which each non-pack template parameter
has semantics determined from a template argument and each template
parameter pack is associated with a list of template arguments
([temp.param], [temp.arg]). The transformed declaration specifies semantics
for the template specialization. [*Note:* The transformed declaration of a
specialization is not found by name lookup, but declares the entity named
when a *template-id* names the specialization ([temp.names]) or when
template argument deduction determines a specialization ([temp.deduct]). - *end

Worth writing a DR or short paper? Corrections, additions, bike-shedding?

Andrew Schepler

Received on 2021-04-25 08:11:51