M
Mr Dyl
I'm having a few issues porting Windows code to Linux (VS.Net 2003 to
GCC 4.0.1). So this probably has something to do with VS not catching
non-compliant code. I'd like to simplify this problem, but I'm not
really sure what the issue is. I appologize in advance, as this
doesn't give you much to go on. Basically, I want to compare my own
iterators with stl vector iterators. I've written the operator== and
operator!= functions to do this (actually, they're methods... I
couldn't figure out how to make them static functions due to a host of
other issues we probably don't need to get into). I'm hoping that
maybe somebody can spot a clue in the error message. Here's the
problem code:
CHAIN_CONTAINER::const_iterator stl_itEnd =
my_itChain->getOwner()->getChains().end();
if (my_itChain != stl_itEnd) // OK
do_something();
fi (my_itChain != my_itChain->getOwner()->getChains().end()) // GCC
complains
do_something();
Here's the error message I'm getting on the fourth line:
ContainerChild.cpp: In member function 'ContainerChild:jt_iterator
ContainerChild::beginPJT(Container<A, B, C, D>::c_iterator&)':
ContainerChild.cpp:133: error: no match for 'operator!=' in 'itC !=
(+(+ itC)->Container<T1, T2, T3, T4>::c_iterator:perator-> [with T1 =
A, T2 = B, T3 = C, T4 =
D]()->C::getOwner()->B::<anonymous>.BParent::getChains())->std::vector<_Tp,
_Alloc>::end [with _Tp = CParent*, _Alloc =
std::allocator<CParent*>]()'
.../common/Container.h:223: note: candidates are: bool Container<T1, T2,
T3, T4>::c_iterator:perator!=(const Container<T1, T2, T3,
T4>::c_iterator&) [with T1 = A, T2 = B, T3 = C, T4 = D]
.../common/Container.h:225: note: bool Container<T1, T2,
T3, T4>::c_iterator:perator!=(__gnu_cxx::__normal_iterator<CParent*
const*, std::vector<CParent*, std::allocator<CParent*> > >&) [with T1 =
A, T2 = B, T3 = C, T4 = D]
Thanks in advance!
GCC 4.0.1). So this probably has something to do with VS not catching
non-compliant code. I'd like to simplify this problem, but I'm not
really sure what the issue is. I appologize in advance, as this
doesn't give you much to go on. Basically, I want to compare my own
iterators with stl vector iterators. I've written the operator== and
operator!= functions to do this (actually, they're methods... I
couldn't figure out how to make them static functions due to a host of
other issues we probably don't need to get into). I'm hoping that
maybe somebody can spot a clue in the error message. Here's the
problem code:
CHAIN_CONTAINER::const_iterator stl_itEnd =
my_itChain->getOwner()->getChains().end();
if (my_itChain != stl_itEnd) // OK
do_something();
fi (my_itChain != my_itChain->getOwner()->getChains().end()) // GCC
complains
do_something();
Here's the error message I'm getting on the fourth line:
ContainerChild.cpp: In member function 'ContainerChild:jt_iterator
ContainerChild::beginPJT(Container<A, B, C, D>::c_iterator&)':
ContainerChild.cpp:133: error: no match for 'operator!=' in 'itC !=
(+(+ itC)->Container<T1, T2, T3, T4>::c_iterator:perator-> [with T1 =
A, T2 = B, T3 = C, T4 =
D]()->C::getOwner()->B::<anonymous>.BParent::getChains())->std::vector<_Tp,
_Alloc>::end [with _Tp = CParent*, _Alloc =
std::allocator<CParent*>]()'
.../common/Container.h:223: note: candidates are: bool Container<T1, T2,
T3, T4>::c_iterator:perator!=(const Container<T1, T2, T3,
T4>::c_iterator&) [with T1 = A, T2 = B, T3 = C, T4 = D]
.../common/Container.h:225: note: bool Container<T1, T2,
T3, T4>::c_iterator:perator!=(__gnu_cxx::__normal_iterator<CParent*
const*, std::vector<CParent*, std::allocator<CParent*> > >&) [with T1 =
A, T2 = B, T3 = C, T4 = D]
Thanks in advance!