🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.upgrade
3 messages
3 total messages Started by Bruce Fri, 17 Feb 2006 01:09
Cannot convert 'std::_Vector_iterator<unsigned char,std::allocator<unsigned char> >' to 'unsigned char *' ?
#497
Author: Bruce
Date: Fri, 17 Feb 2006 01:09
15 lines
1387 bytes
Ok,
How about this one?

I'm geting this error:

Cannot convert 'std::_Vector_iterator<unsigned 
char,std::allocator<unsigned char> >' to 'unsigned char *'

AND it won't let me cast it?

It compiled and ran file under BCB6.0 but won't compile under 2006.

Thanks again...

Bruce
Re: Cannot convert 'std::_Vector_iterator<unsigned char,std::allocator<unsignedchar> >' to 'unsigned char *' ?
#498
Author: Bruce
Date: Fri, 17 Feb 2006 01:46
31 lines
1646 bytes
Bruce wrote:

> Ok,
> How about this one?
> 
> I'm geting this error:
> 
> Cannot convert 'std::_Vector_iterator<unsigned 
> char,std::allocator<unsigned char> >' to 'unsigned char *'
> 
> AND it won't let me cast it?
> 
> It compiled and ran file under BCB6.0 but won't compile under 2006.
> 
> Thanks again...
> 
> Bruce
> 

Ok I figured this out...

I needed to dereference the pointer..

I wonder how come it compiled before?

(I should probably investigate... B)

Thanks  again guys...


Bruce
Re: Cannot convert 'std::_Vector_iterator<unsigned char,std::allocator<unsignedchar> >' to 'unsigned char *' ?
#512
Author: AlisdairM
Date: Mon, 06 Mar 2006 11:39
39 lines
2228 bytes
Bruce wrote:

> Ok I figured this out...
> 
> I needed to dereference the pointer..
> 
> I wonder how come it compiled before?
> 
> (I should probably investigate... B)
> 
> Thanks  again guys...

You probably figured this out already, but just in case <g>

With STLport, the standard library that shipped with BCB6,
vector::iterator was simply a typedef of T *.  With the Dinkumware
library, vector::iterator is a class in its own right, which allows for
stricter type-checking, run time bounds checking, etc.

According to the standard, both are permitted - although there is a
wide (not unanimous) consensus that Dinkumware's way of doing things is
'better'.

Unfortunately, any code that made the assumption that vector (or
string) iterators were raw pointers will break with the new compiler.
However, that code was always 'broken' in the sense that it was not
portable, but relied on an implementation detail of the STLport library.

Small comfort when it is your own code that needs fixing though ;?)

Another change you might find with Dinkumware is that it does a much
better job of isolating std headers, so if you include one standard
header you do not get a lot of others included for free - as
implementation details.  We found a lot of our code relying on
'accidental includes' in the STLport library.  These were comparatively
easy to clean up though.

-- 
AlisdairM(TeamB)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads