public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Yogesh Kini <kini1982@postmaster.co.uk>
To: gcc-help@gcc.gnu.org
Subject: STL iterator problem
Date: Wed, 24 Nov 2004 08:21:00 -0000	[thread overview]
Message-ID: <PM.29108.1101284477@pmweb14.uk1.bibliotech.net> (raw)

Hi,
Please take a look at the code snippet below.
The code compiles fine with Microsoft VC++ but gives a error with gcc(as indicated below)
I am trying to port the file from msvc to gcc. Can anyone suggest me a work around. 

Thanks
Yogesh


#include <stdio.h>
#include <list>
 
template <class B>
class parent
{
public:
	B * m_Container;			
	void funone();
	void CreateList()
	{
		m_Container = new B();  
		m_Container->push_front(1);		
		m_Container->push_front(2);		
		m_Container->push_front(3);		
		m_Container->push_front(4);		
	}
	B * GetList()
	{
		return (m_Container);
	}
};
 

template<class B>
void parent<B>::funone()
{
	B * the_Container = GetList();
	for(B::iterator i = the_Container->Begin(); i != the_Container->end(); ++i  )  -> Error Here: Parse error before "=" token
	{
		printf("%d ",*i);	
	}	
}
 
int main()
{ 
	parent<std::list<int>> the_instance;
	the_instance.CreateList();
	the_instance.funone();
}

Error: parse error before "=" token



___________________________________________________
Have your own email and web address for life.

http://www.homemaster.net - Homemaster. Come Together. Online.

             reply	other threads:[~2004-11-24  8:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-24  8:21 Yogesh Kini [this message]
2004-11-24  8:29 ` Philippe Haution
2004-11-24 11:55   ` jlh
2004-11-24 14:50     ` Eljay Love-Jensen
2004-11-24 15:02 Martin York

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=PM.29108.1101284477@pmweb14.uk1.bibliotech.net \
    --to=kini1982@postmaster.co.uk \
    --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).