英文:
Are precompield headers a good way to hide code?
问题
我一直在做一个项目,最好能隐藏头文件的内容。我最近想到了预编译头文件。这些东西有多有效的使用案例呢?
英文:
I've been working on a project where preferably I would hide the contents of the header files. I came to the idea recently of precompiled headers. How valid of a use case are these things?
答案1
得分: 0
对于未来的任何人来说,预编译头文件不是解决方案,因为其输出不是平台无关的。应优先使用pimpl模式[或类似概念]。
英文:
For anyone in the future, a precompiled header is not the answer simply because its output is not platform independent. Use of the pimpl idiom [or similar concepts] should be greatly preferred.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论