Kiwi
2005-04-07 11:08:08 UTC
I am passing fromURL as shown below
bool WebStuff::AccessInternet(AnsiString sURL, TStringList *fromURL)
Remy introduced me to auto_ptrs and I was wondering how to pass an auto_ptr
as an argument in a function
I tried doing:
std::auto_ptr<TStringList> fromURL(new TStringList);
bool WebStuff::AccessInternet(AnsiString sURL, const
std::auto_ptr<TStringList> &fromURL)
but fromURL doesn't get passed properly.
I suspect there is a way to pass an auto_ptr as a function argument, I have
seen some relevant references
but I don't understand what I read.
Any help on the pros, cons, and mechanism for passing auto_ptrs as function
arguments would be much appreciated.
Thanks,
Kiwi
bool WebStuff::AccessInternet(AnsiString sURL, TStringList *fromURL)
Remy introduced me to auto_ptrs and I was wondering how to pass an auto_ptr
as an argument in a function
I tried doing:
std::auto_ptr<TStringList> fromURL(new TStringList);
bool WebStuff::AccessInternet(AnsiString sURL, const
std::auto_ptr<TStringList> &fromURL)
but fromURL doesn't get passed properly.
I suspect there is a way to pass an auto_ptr as a function argument, I have
seen some relevant references
but I don't understand what I read.
Any help on the pros, cons, and mechanism for passing auto_ptrs as function
arguments would be much appreciated.
Thanks,
Kiwi