Article View: comp.std.c++
Article #2343Re: Template Instantiation
From: Sean A Corfield
Date: Sun, 29 Oct 1995 19:53
Date: Sun, 29 Oct 1995 19:53
33 lines
1852 bytes
1852 bytes
In article <9510272025.AA09665@absoft.absoft.com>, "Michael Rice" <mpr@absoft.com> wrote: |> I have a question concerning class template instantitation, as described |> in section 14.3.2 on the Sep 1995 WP. [snip] |> The section goes on the give examples of a few cases that do require |> instantiation and a few that do not require instantiation. It seems |> to me, that it should state EXACTLY when they are required and it |> doesn't seem to in this section. Does it anywhere? If it is not |> stated implementations could decide anything in a requirement. Couldn't |> they? Well, the intent of the committee regarding template classes is that they should be instantiated precisely when the class types are required to be complete or when certain ptr to class casts are used. However, the WP doesn't yet clearly explain when function templates are required to be instantiated, and the example you gave is certainly a boundary case -- the return type of a function is not required to be a complete type until (a) the definition point or (b) the use point. I'd say that the <long> iterator should _not_ be instantiated but the WP certainly doesn't make that clear. Perhaps we'll work on it next week in Tokyo. --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<ACB958A1966835486@158.152.79.67>Path:
arc1-ca.pugleaf.net!news.mindlink.net!agate!agate!MattReferences:
<9510272025.AA09665@absoft.absoft.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.mindlink.net!agate!agate!Matt From: Sean A Corfield <sean@corf.demon.co.uk> Newsgroups: comp.std.c++ Subject: Re: Template Instantiation Date: 29 Oct 1995 19:53:44 GMT Organization: OCS Approved: Matt@Austern Message-ID: <ACB958A1966835486@158.152.79.67> References: <9510272025.AA09665@absoft.absoft.com> NNTP-Posting-Host: austern.hip.berkeley.edu