Article View: borland.public.cppbuilder.nativeapi
Article #13868Re: std::auto_ptr<> Help Please, Part 2
From: Remy Lebeau (TeamB)
Date: Sun, 14 Sep 2003 04:44
Date: Sun, 14 Sep 2003 04:44
31 lines
1804 bytes
1804 bytes
"dcent" <DcentJ8@NetScape.net> wrote in message
news:3F63E3D7.7050506@NetScape.net...
> How can I pass what the auto_ptr is holding into a function?
auto_ptr has a get() method for retreiving the pointer that it is holding on
to:
> void _fastcall LoadList(TStringList *sl); //or should it be
> (TStringList &sl)
No, it should be a pointer, not a reference.
> std::auto_ptr<TStringList> sl(new TStringList(this));
TStringList's constructor does not take any parameters:
std::auto_ptr<TStringList> sl(new TStringList);
> LoadList(sl); //<-- throws an error
LoadList(sl.get());
Gambit
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03
Technical Details
Message-ID:
<3f63f206$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3F5E64B4.4050201@NetScape.net> <3F63E3D7.7050506@NetScape.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,da48c8ace4f19025 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-09-13 21:46:29 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3F5E64B4.4050201@NetScape.net> <3F63E3D7.7050506@NetScape.net> Subject: Re: std::auto_ptr<> Help Please, Part 2 Date: Sat, 13 Sep 2003 21:44:39 -0700 Lines: 33 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3f63f206$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1063514630 207.175.226.26 (13 Sep 2003 21:43:50 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail