N3690, paragraph 14.8.2 of paragraph 3 has this rather breathtaking example:
template <class Z> void h(Z, Z*);
h<const int>(1,0);
Question: why is it not h(const int, const int*)
?
How is it known, Z = const int
therefore, each appearance Z
in the template declaration can be read as const int
, or am I missing something? Why is the pointer different? I remember that when a parameter has T&
or T*
, it saves cv-qualifiers T
, but I see no way to apply it here.
source
share