Topic: Nested Class of a Template Class


Author: euclidonomy@hotmail.com ("Shane Neph")
Date: Fri, 6 Sep 2002 19:12:30 +0000 (UTC)
Raw View
Hi,
  I have no trouble compiling the following code with the Comeau online
compiler, but VC++.net gives me the following error message:

"error C2687: cannot define a nested UDT of a template class out of line"

  As the message implies, the MS compiler has no problem if I define the
nested class inside of SPTSMap<,>.  I tend to believe the Comeau compiler,
but I was wondering if anyone *knows* which compiler is in compliance with
the C++ standard in regards to this situation?


template <typename TagType, typename ContainerType>
class SPTSMap
{
     class Storage; // forward declaration of private, nested class
public:
     void push_back();
     bool FindAndFill();
};

// Nested Class Definition
template <typename TagType, typename ContainerType>
class SPTSMap<TagType, ContainerType>::Storage
{
     /* whatever */
};

Thanks for any/all help.
-Shane


---
[ 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    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]