If I have this:

class FormBase {
public:
        template<typename Controller>
        Controller & getController() const 
                { return dynamic_cast<Controller>(controller_); }
private:
        ControllerBase & controller_;
};

class FormCitation : FormBase {
public:
        void apply () {
                ControlCommand & params = 
                        getController<ControlCitation>().params();
        }
};


Can I define a shortcut in FormCitation.C. Something like:
typedef getController<ControlCitation> controller;

or even
#define controller() getController<ControlCitation>()

????

By "can I" I mean:
1. Is it possible in C++
2. Is it permissible within LyX.


-- 
Angus

Reply via email to