简体   繁体   English

私有包括头文件

[英]Private including header file

我有头文件A ,其中包含头文件B来获取函数,但我想要当包含头A不访问头B 的函数时。

Here's one way to deal with the problem.这是处理问题的一种方法。

  1. Create file Ch .创建文件Ch The contents of Ch must be minimized so that it only has what's absolutely essential for use in Ah Ch的内容必须最小化,以便它只包含在Ah绝对必要的内容
  2. Include Ch in Ah and Bh .AhBh包含Ch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM