C++, removing #include or #include in class header

后端 未结 12 1470
感情败类
感情败类 2021-01-03 06:37

I want to remove, if possible, the includes of both and from my class header file. Both string and vector are return types of functions declare

12条回答
  •  不知归路
    2021-01-03 07:11

    With a very few exceptions, you are not allowed to add things to the std:; namespace. For classes like vector and string, you therefore have no option but to #include the relevant Standard header files.

    Also, notice that string is not a class, but a typedef for basic_string.

提交回复
热议问题