help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Template inner class problem


From: Jeff Schwab
Subject: Re: Template inner class problem
Date: Thu, 29 Nov 2007 14:17:43 -0800 (PST)
User-agent: G2/1.0

On Nov 28, 4:51 am, Wojtek Michalik <wojmic...@poczta.onet.pl> wrote:
> template<typename T> class Stack {
>   struct Link {
...
>   }* head;
...
>   class iterator { // Now define it
>
>     Stack::Link* p;

    Link* p;

> /* Compile error int above line
> compiled with: g++ -fpermissive -c TStack2Test.cpp
> error: type 'Stack<T>' is not derived from type 'Stack<T>::iterator'
> error: expected ';' before '*' token
>
> */
>
>   public:
...
>     // operator++ returns boolean indicating end:
>     bool operator++() {

Please don't do that.  Post any questions about the proper semantics
of operator++ here, or in comp.lang.c++, or in comp.lang.c++.moderated.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]