[Bug c++/52978] Inherit from Template with specified type and override virtual function

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Apr 13 20:48:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52978

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-13 20:48:13 UTC ---
No, that's absolutely not how C++ works.  Templates are not macros.

The template's function parameter is "const T&" aka "T const&"
i.e. a reference to a const T

If T is a pointer then it is a reference to a const pointer.  That's not the
same as a reference to a pointer to const.

http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.4



More information about the Gcc-bugs mailing list