This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
stl_vector.h problem
- To: libstdc++@sourceware.cygnus.com
- Subject: stl_vector.h problem
- From: Vadim Egorov <egorovv@1c.ru>
- Date: Fri, 30 Apr 1999 15:46:18 +0400
Hello,
When compiling of the following program I get errors in stl_vector.h.
I am using recent CVS versions of libstdc++ and egcs under cygwin32.
Obviously errors are caused by change in std::vector iterators.
In SGI's stl_vector.h they are sometimes mixed with plain pointers
such as _M_start,_M_finish, _M_end_of_storage.
I don't have that much courage to track and patch all such places.
Vadim Egorov.
//file test.cpp
#include <vector>
template<typename T>
struct A {};
struct B {};
void foo()
{
std::vector< A<B> > vec;
vec.reserve(100);
}
gcc -g -c test.cpp -I/usr/local/include/g++-v3
/usr/local/include/g++-v3/bits/stl_vector.h: In method `size_t
vector<A<B>,allocator<A<B> > >::capacity() const':
/usr/local/include/g++-v3/bits/stl_vector.h:284: instantiated from
`vector<A<B>,allocator<A<B> > >::reserve(unsigned int)'
atomtest.cpp:15: instantiated from here
/usr/local/include/g++-v3/bits/stl_vector.h:216: no match for `A<B>
*const & - __normal_iterator<const A<B> *,vector<A<B>,allocator<A<B> > >
>'
/usr/local/include/g++-v3/bits/stl_vector.h:216: warning: control
reaches end of non-void function `vector<A<B>,allocator<A<B> >
>::capacity() const'
/usr/local/include/g++-v3/bits/stl_vector.h: In method `class
__normal_iterator<A<B> *,vector<A<B>,allocator<A<B> > > >
vector<A<B>,allocator<A<B> > >::_M_allocate_and_copy<A<B> *>(unsigned
int, A<B> *, A<B> *)':
/usr/local/include/g++-v3/bits/stl_vector.h:286: instantiated from
`vector<A<B>,allocator<A<B> > >::reserve(unsigned int)'
atomtest.cpp:15: instantiated from here
/usr/local/include/g++-v3/bits/stl_vector.h:444: no matching function
for call to `vector<A<B>,allocator<A<B> > >::_M_deallocate
(__normal_iterator<A<B> *,vector<A<B>,allocator<A<B> > > > &, size_t &)'
/usr/local/include/g++-v3/bits/stl_vector.h:95: candidates are: void
_Vector_alloc_base<A<B>,allocator<A<B> >,>::_M_deallocate(A<B> *,
unsigned int)
/usr/local/include/g++-v3/bits/stl_vector.h: In method `void
vector<A<B>,allocator<A<B> > >::reserve(unsigned int)':
atomtest.cpp:15: instantiated from here
/usr/local/include/g++-v3/bits/stl_vector.h:289: cannot convert `__tmp'
from type `__normal_iterator<A<B> *,vector<A<B>,allocator<A<B> > > >' to
type `A<B> *'
atomtest.cpp:15: instantiated from here
/usr/local/include/g++-v3/bits/stl_vector.h:290: cannot convert
`__normal_iterator<A<B> *,vector<A<B>,allocator<A<B> > >
>((&__old_size))' from type `__normal_iterator<A<B> *,vector<A<B>,allocator<A<B> > > >' to type `A<B> *'
--
*********************************************
Vadim Egorov, 1C * Вадим Егоров,1C
egorovv@1c.ru * egorovv@1c.ru
*********************************************