Re: Using C++ AutoPtr within an Obj C file.
Re: Using C++ AutoPtr within an Obj C file.
- Subject: Re: Using C++ AutoPtr within an Obj C file.
- From: John Draper <email@hidden>
- Date: Fri, 05 Aug 2005 11:53:52 -0700
Scott Ribe wrote:
First off, I was told I had to change the .m suffix to .mm suffix if I
intend to
call C++ code implemented in .cxx files. Not sure if Apple supports
the .cxx
suffix - nor could I find anything that says I shouldn't. Should I
leave the files
as .cxx?
.cpp is a C++ file, not an Objective-C++ file.
Yes - I know that, a .mm file is a Objective-C++ file if I'm not mistaken.
But this library has them labled as .cxx files. Can I leave them the
same when
compiling them under X-Code, or do I have to change them to .cpp.
For instance, the statement:
auto_ptr<ClientAuthManager> clientAuth(new ClientAuthManager);
The auto_ptr class has a constructor, so you can't embed it directly in an
Objective-C object (unless you use the new Tiger-only compile option).
Ouch - is there any workaround... this library uses this extensively,
but is
compiled into a C++ file, and not integrated into Obj C.
I intend to use this C++ construct in my "init" method of my
"controller.mm" file. Is this
permitted?
Well, it's permitted, but it will only create a local variable, not an ivar
of an Objective-C class...
so - you say I can use
auto_ptr<ClientAuthManager> clientAuth(new ClientAuthManager);
Where "clientAuth" is a local variable and not a ObjC "ivar"?
is that what you are saying?
John
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden