• 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: constructor cannot be overloaded?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: constructor cannot be overloaded?


  • Subject: Re: constructor cannot be overloaded?
  • From: Rick Mann <email@hidden>
  • Date: Wed, 30 Mar 2011 17:36:16 -0700

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

_______________________________________________

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

  • Follow-Ups:
    • Re: constructor cannot be overloaded?
      • From: Scott Ribe <email@hidden>
    • Re: constructor cannot be overloaded?
      • From: David Duncan <email@hidden>
    • Re: constructor cannot be overloaded?
      • From: Rick Mann <email@hidden>
References: 
 >constructor cannot be overloaded? (From: Rick Mann <email@hidden>)

  • Prev by Date: constructor cannot be overloaded?
  • Next by Date: Re: constructor cannot be overloaded?
  • Previous by thread: constructor cannot be overloaded?
  • Next by thread: Re: constructor cannot be overloaded?
  • Index(es):
    • Date
    • Thread