Article View: borland.public.cppbuilder.migration
Article #112Re: BCB6 project to CB2007 problem.
From: Leo Siefert
Date: Thu, 26 Jun 2008 13:53
Date: Thu, 26 Jun 2008 13:53
27 lines
1796 bytes
1796 bytes
Gene wrote: >Cannot convert std::_Vector_iterator<std::string> to std::string * You are attempting to do something that is dependent upon the implementation of the STL. a vector iterator is allowed by the standard to be an array pointer, but it does not have to be one. There is nothing in the standard that allows this type of conversion. This worked in BCB6 because that used a different STL which used pointers as vector iterators, and does not work in CB2007 because it uses a different STL. Since this is an implementation dependent detail, you are best to use code that does not rely on it. Either use vector<>::iterator as your function parameters, etc. or convert to a pointer if necessary like this: &*TheIterator; In the code you posted, you can simply use the iterator itself with pointer syntax (iterators to have * and -> implemented like pointers do): ShowMessage(it->c_str()); - Leo
Technical Details
Message-ID:
<9q67645lnbvgs0vigq5dek391leqco3a7e@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.sovam.com!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mailReferences:
<486344ca@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 110f51,707ee0890811ca3 X-Google-Attributes: gid110f51,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Leo Siefert <lIHATESPAMsiefert@senate.michigan.gov> Newsgroups: borland.public.cppbuilder.migration Subject: Re: BCB6 project to CB2007 problem. Date: Thu, 26 Jun 2008 09:53:52 -0400 Message-ID: <9q67645lnbvgs0vigq5dek391leqco3a7e@4ax.com> References: <486344ca@newsgroups.borland.com> X-Newsreader: Forte Agent 3.3/32.846 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 198.109.173.45 X-Trace: newsgroups.borland.com 1214488431 198.109.173.45 (26 Jun 2008 06:53:51 -0700) Lines: 27 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.sovam.com!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mail