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 

Cannot convert 'std::_Vector_iterator<unsigned char,std::all

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





PostPosted: Fri Feb 17, 2006 2:03 am    Post subject: Cannot convert 'std::_Vector_iterator<unsigned char,std::all Reply with quote



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
Back to top
Bruce
Guest





PostPosted: Fri Feb 17, 2006 2:03 am    Post subject: Re: Cannot convert 'std::_Vector_iterator<unsigned char,std: Reply with quote



Bruce wrote:

Quote:
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
Back to top
David Dean
Guest





PostPosted: Fri Feb 17, 2006 3:03 am    Post subject: Re: Cannot convert 'std::_Vector_iterator<unsigned char,std: Reply with quote



In article <43f529c4$1 (AT) newsgroups (DOT) borland.com>,
Bruce <bruce_l (AT) westbrookent (DOT) com> wrote:

Quote:
I wonder how come it compiled before?

My first guess is that BCB 2006 is a little stricter about code
conforming to the standard.

--
-David

Nihil curo de ista tua stulta superstitione.
Back to top
AlisdairM
Guest





PostPosted: Mon Mar 06, 2006 1:03 pm    Post subject: Re: Cannot convert 'std::_Vector_iterator<unsigned char,std: Reply with quote

Bruce wrote:

Quote:
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)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Upgrade) 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.