This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: problem with inner classes in template functions
- To: glier at stud dot uni-frankfurt dot de (Oliver Glier)
- Subject: Re: problem with inner classes in template functions
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- Date: Thu, 22 May 1997 13:24:31 +1000 (EST)
- Cc: gnu-win32 at cygnus dot com (Cygnus GNU-win32 mailing list)
Oliver Glier, you wrote:
>
> template<class C>
> void createIterator(const C&)
> {
> C::Iterator it;
> it.setnull();
> }
...
> The compiler always yields a syntax error at the line with
> "C::Iterator it;" in function createIterator().
The compiler is correct. The above is not valid C++ syntax
(no matter what all those other compilers do).
I think the correct syntax is
typename C::Iterator it;
^^^^^^^^
This syntax is a fairly recent addition to C++, and
I have no idea whether the cygwin g++ supports it yet
(and no intention of rebooting my Linux box in W95 mode
to find out ;-).
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".