我想預定義派生類如下,預定義派生類
class Base{
}
class Derived;
class Unreleated{
Base* ptr;
public:
Unreleated& operator, (const Unreleated& m){
static_cast<Derived*>(ptr); // pointer is a derived.
return *this;
}
}
class Derived : public Base{
//this is a container holding a bunch of unrelated.
}
,但我越來越無效靜態澆鑄從基地*派生*?