Article View: borland.public.cppbuilder.upgrade
Article #512Re: Cannot convert 'std::_Vector_iterator<unsigned char,std::allocator<unsignedchar> >' to 'unsigned char *' ?
From: AlisdairM
Date: Mon, 06 Mar 2006 11:39
Date: Mon, 06 Mar 2006 11:39
39 lines
2228 bytes
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)
Technical Details
Message-ID:
<440c2d9f@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<43f5213b$1@newsgroups.borland.com> <43f529c4$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10529a,6479e61947bbbd78 X-Google-Attributes: gid10529a,public X-Google-Language: ENGLISH,ASCII-7-bit From: "AlisdairM" <alisdair.meredith@uk.renaultf1.com> Subject: Re: Cannot convert 'std::_Vector_iterator<unsigned char,std::allocator<unsignedchar> >' to 'unsigned char *' ? Newsgroups: borland.public.cppbuilder.upgrade References: <43f5213b$1@newsgroups.borland.com> <43f529c4$1@newsgroups.borland.com> User-Agent: XanaNews/1.17.6.6 NNTP-Posting-Host: 195.153.139.2 Message-ID: <440c2d9f@newsgroups.borland.com> Date: 6 Mar 2006 04:39:59 -0700 X-Trace: newsgroups.borland.com 1141648799 195.153.139.2 (6 Mar 2006 04:39:59 -0700) Lines: 39 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail