I might be a bit tired, but why does the following not work?
class Signal {
public:
Signal() {
}
protected:
std::vector<double> data;
};
class Something : public Signal {
public:
Something()
{
data.resize(100);
}
};
class Parser : public Signal {
public:
Parser() {
std::cout << this->data.size();
}
};
int main()
{
Something w; // resizes vector data to 100
Parser f; // outputs size
}
Since I call Something
which resizes the vector.. But, in Parser
I can't seem to access the data
member?
Arghh!
The output is 0
-> If, however, I inherit from Something
it will work?