STL related compile error in debug mode
STL related compile error in debug mode
- Subject: STL related compile error in debug mode
- From: "Mathieu Coursolle" <email@hidden>
- Date: Mon, 14 May 2007 11:56:24 -0400
- Organization: Rogue Research
Hi XCode users,
I am currently using stl list in an application and turned on
some debug flags:
-D_GLIBCXX_DEBUG and -D_GLIBCXX_DEBUG_PEDANTIC
Those caused a new compiler error to the following code:
std::list<unsigned int> theList;
theList.push_back(2);
std::list<unsigned int>::const_iterator theIter1 = theList.begin();
std::list<unsigned int>::const_iterator theIter2 = theList.begin();
int x = 0;
if (theIter1.operator != (theIter2))
{
x = 1;
}
The compiler error is:
"class __gnu_debug::_Safe_iterator<__
gnu_norm::_List_const_iterator<unsigned int>,
__gnu_debug_def::list<unsigned int, std::allocator<unsigned int> > >'
has no member named 'operator!='"
However, that code works just fine without the debug flags.
After a quick search into stl code, I noticed that _Safe_Iterator does
not define de == and !=
operator, but List_Iterator does.
Question 1: Is theIter1.operator != theIter2 the same as theIter1 !=
theIter2 ?
Question 2: Why is _Safe_Iterator not implementing == and != operators?
Thanks a lot!
Mathieu
--
____________________________________________________________
Mathieu Coursolle email@hidden
Rogue Research www.rogue-research.com
Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden