On Tuesday, 2 August 2022 at 14:24:50 UTC, frame wrote:
On Tuesday, 2 August 2022 at 12:39:41 UTC, pascal111 wrote:
Instantiation seems some complicated to me. I read "If a
template contains members whose name is the same as the
template identifier then these members are assumed to be
referred to in a template instantiation:" in the provided
link, but I'm still stuck. Do you have a down-to-earth example
for beginners to understand this concept?
There are obvious examples direct below.
Where do you get stuck?
Maybe this helps:
A template can be seen as a static struct too, so you can
access its members with the scope operator "." and if there is
only one member of the same name as the template ifself, the
compiler auto completes it to this member.
I guess you mean if we will understand the templates concept as a
static struct that the template is like the struct or - "records"
in Pascal - that preserve its members values each time of calling
through the runtime because they are "static". Isn't like that or
what do you mean?