about inheritance, please help
Code:
class Base {
public:
std::size_t size() const { return n; }
protected:
std::size_t n;
};
class Derived : private Base { . . . };
In this hierarchy, size is public in Base but private in Derived. To make size public in Derived we can add a using declaration for it to a public section in Derived:
Code:
class Derived : private Base {
public:
using Base::size;
protected:
using Base::n;
};
Above is what my book tells me. But I found that even if "using" is omitted, size is still made public and n is still made protected. So my question is, is this "using" neccesary? If I omit the "using", what problems will arise?
I'm on WinXp, using msvc++6.
Thanks in advance.