Richard Heck wrote:
Andre Poenitz wrote:
On Thu, Oct 25, 2007 at 09:26:31AM -0400, Richard Heck wrote:
Abdelrazak Younes wrote:
[EMAIL PROTECTED] wrote:
+ /// Return parameter information for command cmdName.
+ /// Not implemented here. Must be implemented in derived class.
+ static CommandInfo const * findInfo(std::string const & cmdName);
So make it pure virtual:

vitual CommandInfo const * findInfo(std::string const & cmdName) = 0;
I didn't do that because it needs, at least in the base classes, to be static, and I wanted to indicate here that it needed to be implemented as a static function. But of course "virtual static" is out, and so is "static blah =0". Thoughts?
class Base
{
public:
static Foo findInfo() { return doFindInfo(); }

protected:
virtual Foo doFindInfo() const = 0;
};


class Derived : public Base
{
protected:
virtual Foo doFindInfo() const { return Something; }
};
Thanks!
Spoke to son. This fails:
../../../src/insets/InsetCommand.h: In static member function 'static const lyx::CommandInfo* lyx::InsetCommand::findInfo(const std::string&)': ../../../src/insets/InsetCommand.h:83: error: cannot call member function 'virtual const lyx::CommandInfo* lyx::InsetCommand::doFindInfo(const std::string&)' without object I take it that the problem is that doFindInfo() is a member function being called from a static function, and so there is no `this'.

rh


--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Reply via email to