Using base class methods to initialize derived class members
<p>Is it legal? If so, do you consider it as good coding practice?</p>

<p>I want to do something like this (nonessential details are not shown):</p>

<pre><code>class ItemStorage {
    int size() const;
};

class SpecialStorage : public ItemStorage  {
public:
    SpecialStorage (...) : ItemStorage(...), items(ItemStorage::size()) {...}
private:
    int items;
};
</code></pre>

<p>I am pretty sure that it is OK if the method <strong>size</strong> is not virtual. What if it is virtual and the derived class doesn't overwrite it?</p>
