Article View: comp.std.c++
Article #4118Re: Member templates
From: David Vandevoorde
Date: Fri, 19 Apr 1996 17:14
Date: Fri, 19 Apr 1996 17:14
32 lines
1977 bytes
1977 bytes
>>>>> "RL" == Roman Lechtchinsky <wolfro@cs.tu-berlin.de> writes:
[...]
RL> class Base
RL> {
RL> virtual void f(int);
RL> };
RL> class Derived : Base
RL> {
RL> template<class T> void f(T);
RL> };
RL> Is this legal? If so, will the template function f(int) override
RL> Base::f(int)? If so, when will it be instantiated? And, last but not
RL> least, which section of the DWP handles this case? Thanks in advance.
I believe this is legal and the instantiated member function is not
virtual (i.e., no overriding), but my reason extrapolates the WPs
somewhat. I base this on the fact that the `signature' of a template
function includes the actual template arguments ([temp.over.link]
14.10.4/3 in the April CD), and that when [class.virtual] 10.3/2
requires `same name', `name' really means template-id and not just
template-name ([temp.names] 14.1).
Daveed
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Technical Details
Message-ID:
<xsoivewlve3.fsf@avs.cs.rpi.edu>Path:
arc1-ca.pugleaf.net!fido.asd.sgi.com!austernReferences:
<31763F3F.805@cs.tu-berlin.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!fido.asd.sgi.com!austern From: vandevod@cs.rpi.edu (David Vandevoorde) Newsgroups: comp.std.c++ Subject: Re: Member templates Date: 19 Apr 1996 10:14:29 PDT Organization: RPI Computer Science Approved: austern@isolde.mti.sgi.com Message-ID: <xsoivewlve3.fsf@avs.cs.rpi.edu> References: <31763F3F.805@cs.tu-berlin.de> NNTP-Posting-Host: isolde.mti.sgi.com X-Original-Date: 18 Apr 1996 23:56:04 -0400 In-Reply-To: Roman Lechtchinsky's message of 19 Apr 96 00:25:29 GMT X-Newsreader: Gnus v5.1 X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBMXfJ9ky4NqrwXLNJAQGQogH+IeiaHyK/0hPHEWaiUG9+6eRSHfvhpMAr brguEM5w78D937ZpIVS0soPqtd3KdtBrVYCg2A66u9xcOY3VhYcexg== =B633 Originator: austern@isolde.mti.sgi.com