• 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
virtual method hidden
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

virtual method hidden


  • Subject: virtual method hidden
  • From: Steve Mills <email@hidden>
  • Date: Thu, 8 Dec 2005 13:29:33 -0600

This warning seems wrong. We have this struct:

struct FolderSpec {
	short vrn;
	long id;
};

And a base class:

class fFolderWatcher {
	public:
		virtual OSErr WatchThisFolder(const short vrn, const long id);
		virtual OSErr WatchThisFolder(const FolderSpec& fold);
};

And a subclass of that:

class dGraphicsFolderWatcher : public fFolderWatcher {
	public:
		virtual OSErr WatchThisFolder(const short vrn, const long id);
};

The warning is that the base class method is being hidden by the subclass method:

fFolderWatcher.h:56: warning: 'virtual OSErr fFolderWatcher::WatchThisFolder(const FolderSpec&)' was hidden
dFolderWatchers.h:29: warning: by 'virtual OSErr dGraphicsFolderWatcher::WatchThisFolder(short int, long int)'


I don't see how this is possible, unless the compiler is deconstructing the FolderSpec into its parts, which just happen to be a short and a long. But why wouldn't it find the base class method that actually takes (short, long)?

(The defs are simplified here for clarity.)

Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: virtual method hidden
      • From: "Sean McBride" <email@hidden>
  • Prev by Date: Re: How do I get dependent unit tests to work for non-framework projects?
  • Next by Date: Re: virtual method hidden
  • Previous by thread: xcodebuild "assertion failed" errors, can't build working project
  • Next by thread: Re: virtual method hidden
  • Index(es):
    • Date
    • Thread