Re: constructor cannot be overloaded?
On Wed, 30 Mar 2011 17:46:28 -0700, David Duncan said: Hey! Look at that! Under certain conditions, NSRect is just typedef to be CGRect (as it should've been all along). You can use NS_BUILD_32_LIKE_64 then you can ensure that this happens in all of your builds (assuming you still support 32-bit with this project). But beware that NS_BUILD_32_LIKE_64 also changes the size of NSInteger in 32bit, which may or may not cause you problems. -- Sean McBride, B. Eng s...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada ___ 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
Re: constructor cannot be overloaded?
On Mar 31, 2011, at 10:49 AM, Sean McBride wrote: On Wed, 30 Mar 2011 17:46:28 -0700, David Duncan said: You can use NS_BUILD_32_LIKE_64 then you can ensure that this happens in all of your builds (assuming you still support 32-bit with this project). But beware that NS_BUILD_32_LIKE_64 also changes the size of NSInteger in 32bit, which may or may not cause you problems. It doesn't change the size; it just changes its definition from int to long. In 32-bit builds, int and long are both 32-bit integers; they're only different in 64-bit builds. It'll only cause problems if you're doing something that requires strict type checking, but otherwise, it should just work. Nick Zitzmann http://www.chronosnet.com/ ___ 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
Re: constructor cannot be overloaded?
On Thu, 31 Mar 2011 11:03:34 -0600, Nick Zitzmann said: You can use NS_BUILD_32_LIKE_64 then you can ensure that this happens in all of your builds (assuming you still support 32-bit with this project). But beware that NS_BUILD_32_LIKE_64 also changes the size of NSInteger in 32bit, which may or may not cause you problems. It doesn't change the size; it just changes its definition from int to long. In 32-bit builds, int and long are both 32-bit integers; they're only different in 64-bit builds. It'll only cause problems if you're doing something that requires strict type checking, but otherwise, it should just work. Quite right. That's what I meant. :) -- Sean McBride, B. Eng s...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada ___ 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
constructor cannot be overloaded?
I have a C++ class I use to wrap CGRect: class Rect : public CGRect { public: Rect(); Rect(const Rect inRect); Rect(const CGRect inRect); Rect operator=(const Rect inRect); Rect operator=(const CGRect inRect); . . . }; I wanted to extend it to allow easy initialization from NSRect as well, so I added appropriate methods: #if __OBJC__ Rect(const NSRect inRect); Rect operator=(const NSRect inRect); #endif But I get a compiler error on these lines: Rect.h:61: error: 'Graphics::Rect::Rect(const NSRect)' cannot be overloaded Rect.h:59: error: with 'Graphics::Rect::Rect(const CGRect)' I'm not sure why this should be the case. Any help is much appreciated! -- Rick ___ 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
Re: constructor cannot be overloaded?
Hey! Look at that! Under certain conditions, NSRect is just typedef to be CGRect (as it should've been all along). Sorry for the noise. -- Rick On Mar 30, 2011, at 17:30 , Rick Mann wrote: I have a C++ class I use to wrap CGRect: class Rect : public CGRect { public: Rect(); Rect(const Rect inRect); Rect(const CGRect inRect); Rect operator=(const Rect inRect); Rect operator=(const CGRect inRect); . . . }; I wanted to extend it to allow easy initialization from NSRect as well, so I added appropriate methods: #if __OBJC__ Rect(const NSRect inRect); Rect operator=(const NSRect inRect); #endif But I get a compiler error on these lines: Rect.h:61: error: 'Graphics::Rect::Rect(const NSRect)' cannot be overloaded Rect.h:59: error: with 'Graphics::Rect::Rect(const CGRect)' I'm not sure why this should be the case. Any help is much appreciated! -- Rick ___ 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/rmann%40latencyzero.com This email sent to rm...@latencyzero.com ___ 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
Re: constructor cannot be overloaded?
Oh, and looks like it's not the first time I've asked this question. Terrifying, since I didn't even have a vague sense of deja vu when looking at it. -- Rick On Mar 30, 2011, at 17:36 , Rick Mann wrote: Hey! Look at that! Under certain conditions, NSRect is just typedef to be CGRect (as it should've been all along). Sorry for the noise. -- Rick On Mar 30, 2011, at 17:30 , Rick Mann wrote: I have a C++ class I use to wrap CGRect: class Rect : public CGRect { public: Rect(); Rect(const Rect inRect); Rect(const CGRect inRect); Rect operator=(const Rect inRect); Rect operator=(const CGRect inRect); . . . }; I wanted to extend it to allow easy initialization from NSRect as well, so I added appropriate methods: #if __OBJC__ Rect(const NSRect inRect); Rect operator=(const NSRect inRect); #endif But I get a compiler error on these lines: Rect.h:61: error: 'Graphics::Rect::Rect(const NSRect)' cannot be overloaded Rect.h:59: error: with 'Graphics::Rect::Rect(const CGRect)' I'm not sure why this should be the case. Any help is much appreciated! -- Rick ___ 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/rmann%40latencyzero.com This email sent to rm...@latencyzero.com ___ 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/rmann%40latencyzero.com This email sent to rm...@latencyzero.com ___ 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
Re: constructor cannot be overloaded?
On Mar 30, 2011, at 5:36 PM, Rick Mann wrote: Hey! Look at that! Under certain conditions, NSRect is just typedef to be CGRect (as it should've been all along). You can use NS_BUILD_32_LIKE_64 then you can ensure that this happens in all of your builds (assuming you still support 32-bit with this project). -- David Duncan ___ 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
Re: constructor cannot be overloaded?
On Mar 30, 2011, at 17:46 , David Duncan wrote: On Mar 30, 2011, at 5:36 PM, Rick Mann wrote: Hey! Look at that! Under certain conditions, NSRect is just typedef to be CGRect (as it should've been all along). You can use NS_BUILD_32_LIKE_64 then you can ensure that this happens in all of your builds (assuming you still support 32-bit with this project). Yeah, I figured this out looking at my old thread on the subject. :-/ (It's NOT a tumor!) -- Rick ___ 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
Re: constructor cannot be overloaded?
On Mar 30, 2011, at 6:36 PM, Rick Mann wrote: Hey! Look at that! Under certain conditions... 64-bit builds, rects, points (and I don't know what else maybe) are the same. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ 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