I have a couple of template classes "Stats<T>" and "Numerical<T>" within a "Statistics" namespace. The Numerical<T> class inherits publicly from Stats<T>. They are defined as below.

```
namespace Statistics { //declare Statistics namespace
template <typename T> class Stats {
protected:
vector<T> dataSet; //contains the actual data set to be analyzed
/* ... other members and declarations ... */
}; //end Stats Class
template <typename T> class Numerical : public Stats<T> {
protected:
double mean; //the numeric average
/* ... other members ... */
void updateMean(); //called by other methods to update the mean when necessary
/* ... other declarations ... */
}; //end Numerical Class
} //end Statistics namespace
```

Now here's where the question comes in. I'm working on the implementation of Numerical<T>::updateMean(), and based on the class structure above, the method should have access to the dataSet vector. The problem that I'm having is that I seem to have to resolve the Stats class every time I want to use one of its members from Numerical. I don't remember having to do that before.

Is this normal? Or is there some nuance that I'm missing somewhere? Do I need to add some sort of using statement(s) to the Numerical class?

Implementation of method:

```
namespace Statistics { //declare Statistics namespace
/* ... other implementations ... */
template <typename T> void Numerical<T>::updateMean() {
vector<T>::const_iterator cpData;
double sigma = 0.0;
if (Stats::dataSet.size() == 0) {
this->mean = 0.0;
return;
}
for (cpData = Stats::dataSet.begin(); cpData != Stats::dataSet.end(); ++cpData) {
sigma += (*cpData);
}
mean = (sigma / Stats::dataSet.size());
}
/* ... other implementations ... */
} //end Statistics namespace
```

I foresee this same issue extending to every other method as well. I know how to deal with it if necessary, but if I can avoid it altogether that would be great.

*Edited 6 Years Ago by Fbody*: n/a