constructor cannot be overloaded?
constructor cannot be overloaded?
- Subject: constructor cannot be overloaded?
- From: Rick Mann <email@hidden>
- Date: Wed, 30 Mar 2011 17:30:59 -0700
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