• 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: Synthesized ivar for std::tr1::shared_ptr<MyClass>?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>?


  • Subject: Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>?
  • From: Kyle Sluder <email@hidden>
  • Date: Fri, 7 May 2010 12:01:30 -0700

On Fri, May 7, 2010 at 11:47 AM, Barry Wark <email@hidden> wrote:
> Your comment brings things into better focus; it appears that template
> instantiation is happening after the compiler attempts to synthesize
> the ivar and accessor methods. Again, my C++-foo is weak but I recall
> that template instantiation happens as a separate compilation step,
> no? Too bad; it's a shame to have to resort to allocating a shared_ptr
> on the heap just to play nicely with modern C++ code that's using RAII
> (including smart pointers) to manage memory.

My C++-foo is similarly weak, but this explanation seems logical if a
bit unfortunate. After all, nothing stops you from creating auto or
static variables of template type, right? So the compiler needs to
specialize templates as it compiles other code; @synthesize
declarations should be no different. Since Cocoa doesn't follow RAII
anyway, I'm not all that distressed.

Perhaps you could provide a public abstract class and hide the
C++-using implementation behind it? I can't think of another solution
that doesn't break the 32-bit runtime.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Synthesized ivar for std::tr1::shared_ptr<MyClass>? (From: Barry Wark <email@hidden>)
 >Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>? (From: Sherm Pendley <email@hidden>)
 >Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>? (From: Barry Wark <email@hidden>)
 >Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>? (From: Kyle Sluder <email@hidden>)
 >Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>? (From: Barry Wark <email@hidden>)

  • Prev by Date: Problem mac os X version 10.6 when using sprinft
  • Next by Date: Re: EXC_BAD_ACCESS on breakpoint
  • Previous by thread: Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>?
  • Next by thread: Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>?
  • Index(es):
    • Date
    • Thread