Angus Leeming <[EMAIL PROTECTED]> writes:
| I've managed to create a GUI-I ControlCitation class that stores a pointer to
| a ButtonController abstract base class. However, in my xforms specific
| FormViewCitation class, I need to access FormButtonController specific
| functions and must, therefore, resort to dynamic_cast.
|
| Are we allowed to use dynamic_cast in LyX code?
No, not yet.
It should be possible to do this without dynamic cast... but perhaps
not directly.
Lgb
|
| Angus
|
|
| aleem@pneumon:frontends-> cxx -std strict_ansi -rtti -o trial trial.C
| aleem@pneumon:frontends-> ./trial
| func1
| func2
|
| trial.C
| ====
|
| #include <iostream>
|
| class Base {
| public:
| virtual ~Base() {}
|
| void func1() { std::cout << "func1" << std::endl; }
| };
|
| class Derived : public Base {
| public:
| void func2() { std::cout << "func2" << std::endl; }
| };
|
| int main()
| {
| Base * cls = new Derived();
|
| cls->func1();
| dynamic_cast<Derived *>(cls)->func2();
|
| return 0;
| }