This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52978] Inherit from Template with specified type and override virtual function
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 13 Apr 2012 20:48:13 +0000
- Subject: [Bug c++/52978] Inherit from Template with specified type and override virtual function
- Auto-submitted: auto-generated
- References: <bug-52978-4@http.gcc.gnu.org/bugzilla/>
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