cansley4puss
Programmer
Is there any way to get a base class's methods to operate on a derived class's static members? - ie
base class
f(){ number++ }
derived class
static int number
The only way of doing this I can find is to make the base class a class template and instantiate a version of the template instead of deriving - ie
class template base
static int number
f() { number++ }
instantiate template and initialise number
But this is messy and confusing. Does anyone know any other workaround for this?
Cheers, Ian.
base class
f(){ number++ }
derived class
static int number
The only way of doing this I can find is to make the base class a class template and instantiate a version of the template instead of deriving - ie
class template base
static int number
f() { number++ }
instantiate template and initialise number
But this is messy and confusing. Does anyone know any other workaround for this?
Cheers, Ian.