Q
qazmlp
Is it a good style to re-forward declare the types, which were already
forward declared in base header file, in derived class header file?
// base.h
class addrClass;
class base
{
public:
virtual void setAddress(addrClass* node);
// Other members
} ;
// derived.h
// Is it a good style to forward declare addrClass here?
// As setAddress method and hence the parameter of type 'addrClass*'
// is from the base class, it may not be required, I suppose.
class derived : public base
{
public:
virtual void setAddress(addrClass* node);
// Other members
} ;
And, similarly, what about #include-ing the header which has to be
added
only because of the Base class method signatures?
forward declared in base header file, in derived class header file?
// base.h
class addrClass;
class base
{
public:
virtual void setAddress(addrClass* node);
// Other members
} ;
// derived.h
// Is it a good style to forward declare addrClass here?
// As setAddress method and hence the parameter of type 'addrClass*'
// is from the base class, it may not be required, I suppose.
class derived : public base
{
public:
virtual void setAddress(addrClass* node);
// Other members
} ;
And, similarly, what about #include-ing the header which has to be
added
only because of the Base class method signatures?