A
abir
Hi,
is there any way forward declare a covariant return type (and is it
a language feature or extension only)?
I have class,
class CompModel;
class CompWorker{
public:
virtual CompModel& model(); /// forward declaration works as
usual.
};
#include "KeyModel.hpp" ///here i need to include it.
class KeyWorker : public CompWorker{
public:
virtual KeyModel& model();
}
where,
class KeyModel : public CompModel{
};
No way i can express a forward decl which inherit from another class.
I am not sure if really any include is needed apart from knowing
inheritance, as KeyModel memory model is not needef for KeyWorker.
Thanks
abir
is there any way forward declare a covariant return type (and is it
a language feature or extension only)?
I have class,
class CompModel;
class CompWorker{
public:
virtual CompModel& model(); /// forward declaration works as
usual.
};
#include "KeyModel.hpp" ///here i need to include it.
class KeyWorker : public CompWorker{
public:
virtual KeyModel& model();
}
where,
class KeyModel : public CompModel{
};
No way i can express a forward decl which inherit from another class.
I am not sure if really any include is needed apart from knowing
inheritance, as KeyModel memory model is not needef for KeyWorker.
Thanks
abir