I ran across something curious in C++. I have always associated the using directive with namespaces, but this one I have not encountered until now.
I saw something like the following code in my work and have not found an explanation of why the code works as it does.
I compile and run it and it works. Comment out the using directive and afunct() is not accessible through class test3. Part of my confusion may be due to the fact that I never really got the hang of protected.
virtual void afunct() =0;
class test2 : public test1
class test3 : protected test2
I am just curious as to how/why it works the way it does.