public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Hubert Felber" <Felber@abacus.ch>
To: <gcc-help@gcc.gnu.org>
Subject: Problems with templates
Date: Tue, 13 Jun 2000 00:14:00 -0000	[thread overview]
Message-ID: <s945fb36.027@gw.abacus.ch> (raw)

Hi,

Can anybody please help me?

I have problems compiling a nested template class, I get the error message:

Wrapper.h:10: declaration of 'class T'
Wrapper.h:6:   shadows template parm 'class T'

I am using g++ 2.95.2. Using another compiler on a non linux platform, this template compiles fine.

How can I change my code that it compiles fine with gcc 2.95.2 ?


Here is the snippet:


template <class T> class CWrapper  // line 6
{

  template <class T> class CCounted         //line 10
  {
    friend class CWrapper<T>;
  private:

    inline CCounted(T* pT) : Count(0), my_pT(pT) 
    {...  } 

    inline ~CCounted()
    {...}

    inline unsigned AddRef()
    { }
    inline unsigned Release() 
    {}

public:
    T* const my_pT;
  };
public:

  inline CWrapper(): m_pCounted(0) {}

  inline CWrapper(T* pT)
  {
    m_pCounted = new CCounted<T>(pT);
    m_pCounted->AddRef();
  }


.....

snipped the rest
....
private:


///////////////////////////////////////////////////////////////////////////////
  CCounted<T>* m_pCounted;

};


             reply	other threads:[~2000-06-13  0:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-13  0:14 Hubert Felber [this message]
2000-06-13  0:43 ` llewelly
2000-06-13  0:46 Hubert Felber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s945fb36.027@gw.abacus.ch \
    --to=felber@abacus.ch \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).