🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Rich Paul Fri, 12 Apr 1996 01:16
Re: Template Syntax
#3998
Author: Rich Paul
Date: Fri, 12 Apr 1996 01:16
50 lines
2567 bytes
Scott Meyers wrote:
> 
> I was under the impression that the use of a template name inside the
> definition of a class template was implicitly considered to be qualified
> by the template parameter(s).  For example, I thought that in
> 
>   template <class T>
>   class Array {
>   public:
>     Array operator=(const Array& rhs);
>     ...
>   };

The following is a quote from the January '96 working paper.  However, I'm told that
that document is already obsolete ( though I gather it's mostly in the library ...

[ moderator's note: the working paper is updated every four months. The January
version is the latest that has been published, but some changes were made at
the March meeting. -sdc ]

--- BEGIN WP QUOTE ---

1 Within the scope of a class template or a specialization of a template
  the  name  of  the  template is equivalent to the name of the template
  followed by the template-parameters enclosed  in  <>.   [Example:  the
  constructor  for Set can be referred to as Set() or Set<T>().  ] Other
  specializations (_temp.spec_) of the  class  can  be  referred  to  by
  explicitly  qualifying  the  template  name with appropriate template-
  arguments.  [Example:
          template<class T> class X {
                  X* p;           // meaning X<T>
                  X<T>* p2;
                  X<int>* p3;
          };
          template<class T> class Y;

          template<> class Y<int> {
                  Y* p;           // meaning Y<int>
          };
   --end example] [Note: see _temp.param_ for  the  scope  of  template-
  parameters.  ]

--- END WP QUOTE ---


[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
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