BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

const_iterator fails with a typedef to deque

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
Tamas Demjen
Guest





PostPosted: Thu Aug 25, 2005 7:14 pm    Post subject: const_iterator fails with a typedef to deque Reply with quote



I'm getting a very weird compiler error with the following sample code
in BCB6:

#include <deque>
typedef std::deque<int> IntList;
void f(IntList::const_iterator it)
{
}

This code should be correct. The error puts me into _deque.h, which is
part of the STL implementation. The error claims a ')' is missing inside
STL, which is not true.

The following compiles fine:
void f()
{
IntList::const_iterator it;
}

and this one too:
void f(deque<int>::const_iterator it)
{
}

It looks like a compiler bug. And here's the workaround:

#include <deque>
typedef std::deque<int> IntList;
namespace BorlandCppWorkaround
{ typedef IntList::const_iterator IntList_const_iterator; }
void f(IntList::const_iterator it)
{
}

I thought it was very odd. What do you think?

Tom
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.