🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2970

Nested template class definitions

#2970
From: Robert DiFalco
Date: Sun, 31 Dec 1995 06:32
35 lines
1436 bytes
How do I define a nested class in a template? It seems to me that logic
could offer this:

   template <class Item>
   class List_
   {
      public:
         .
         .
         .
         class Iterator;
   };


   template <class Item>
   class List_<Item>::Iterator : public CollectionIterators_<Item>
   {
      .
      .
      .
   };

However, in Visual C++ 4.0, this produces the painfully ambiguous error
message "error C2988: unrecognizable template declaration/definition".

So, what gives? Is this an MSVC 4.0 problem, or am I use the incorrect
syntax for defining a nested class outside of the outer classes scope?

TIA,

Robert
---
[ 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: <4c525e$one@nnrp1.news.primenet.com>
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
Date: 31 Dec 95 06:32:14 GMT
Approved: fjh@cs.mu.oz.au
From: Robert DiFalco <difalco@primenet.com>
Newsgroups: comp.std.c++
Subject: Nested template class definitions
X-Original-Date: 30 Dec 1995 21:05:02 -0700
Organization: Primenet Services for the Internet
Message-ID: <4c525e$one@nnrp1.news.primenet.com>
X-Posted-By: ip034.lax.primenet.com
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMOYuzuEDnX0m9pzZAQHzSgF9HTAjZ6fvQgSfBpLSEKkGIW9Ai9cBUVNn
 oWZjk/7Nk9tmvzl3w5Asj/1htAllDuft
 =evMd