• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using C++ AutoPtr within an Obj C file.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using C++ AutoPtr within an Obj C file.


  • Subject: Re: Using C++ AutoPtr within an Obj C file.
  • From: Scott Ribe <email@hidden>
  • Date: Thu, 04 Aug 2005 20:15:09 -0600

> 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.

> 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).

> 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...

--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 665-7007 voice


 _______________________________________________
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

  • Follow-Ups:
    • Re: Using C++ AutoPtr within an Obj C file.
      • From: John Draper <email@hidden>
References: 
 >Using C++ AutoPtr within an Obj C file. (From: John Draper <email@hidden>)

  • Prev by Date: Re: Core Data Many2Many Relationships
  • Next by Date: Re: Faulty NSWindow connection in CoreData doc-based app?
  • Previous by thread: Using C++ AutoPtr within an Obj C file.
  • Next by thread: Re: Using C++ AutoPtr within an Obj C file.
  • Index(es):
    • Date
    • Thread