Why is no qualification necessary?

后端 未结 4 639
梦如初夏
梦如初夏 2021-02-13 12:22

OK, I\'ll just post the complete program even though it has extraneous stuff and the code in question is the dead code…

#include 
#include         


        
4条回答
  •  遇见更好的自我
    2021-02-13 13:08

    When you derive from the class you have specify

    std::ifstream
    

    to be able to find the class in the std namespace.

    In the code itself you class derived from std::ifstream knows everything of ifstream.

    Inheritance of ifstream:

    ios_base -> ios -> istream -> ifstream
    

提交回复
热议问题