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

后端 未结 12 1377
感情败类
感情败类 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 06:57

    Maybe you would better use the pimpl idiom: it appears to me that you don't want to expose the implementation of your class to client code. If the vector and string objects are aggregated by value, the compiler needs to see their full declarations.

提交回复
热议问题