🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Brian Glendenning Wed, 20 Sep 1995 21:18
Template member function specializations
#2002
Author: Brian Glendenning
Date: Wed, 20 Sep 1995 21:18
19 lines
1259 bytes
Sorry for asking a question that is answered in the DWP - unfortunately a couple
of us are disagreeing about what the DWP says!

We know that a template global function can be specialized. We know that a whole
template class can be specialized. We also know that these specializations must
be declared before they are used.

Can an individual member function of a template class be specialized. If so, how
is it declared? Thanks.

Brian
--
        Brian Glendenning - National Radio Astronomy Observatory
bglenden@nrao.edu              Socorro NM               (505) 835-7347

[ 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. ]
Re: Template member function specializations
#2025
Author: Mumit Khan
Date: Sun, 24 Sep 1995 20:24
44 lines
2079 bytes
In article <199509202116.PAA02269@colobus.aoc.nrao.edu>,
Brian Glendenning  <bglenden@aoc.nrao.edu> wrote:
>
>
>Can an individual member function of a template class be specialized. If so, how
>is it declared? Thanks.
>
>Brian

DWP says the following: 

====
14.5  Template specialization                              [temp.spec]

1 Except for a type member or template class member of a non-specialized
  template  class,  the following can be declared by a declaration where
  the declared name is a template-id: a specialized template function, a
  template class, or a static member of a template; that is:
          specialization:
                  declaration
  [Note: a static member of a template can only be specialized in a #define-
  inition due to syntactic restrictions.  ] [Example:

====

Since a member function of a template class is none of the following:
    - specialized template function
    - template class
    - static member of a template

I would read this as saying that a member function of a template class
cannot be specialized.

Wonder why the restriction on template class members ...

regards,
mumit -- khan@xraylith.wisc.edu
http://www.xraylith.wisc.edu/~khan/

Cc: c.std.c++, Brian Glendenning  <bglenden@aoc.nrao.edu>

[ 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. ]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads