On Fri, May 7, 2010 at 11:47 AM, Barry Wark <barryw...@gmail.com> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to