如何在项目中仅包含 BOOST 智能指针代码?
仅包含 boost 智能指针库而不将所有 boost 库添加到项目中的最佳实践是什么?
我只想在我的项目中使用 boost 智能指针库,并且我不想为此将 200 MB 源代码 (boost 1.42.0) 签入/提交到我的项目存储库中。更重要的是,我的 Windows Mobile 项目本身甚至没有达到该大小的 10%!
What are best practices to include boost smart pointer library only without adding all boost libraries into the project?
I only want boost smart pointer library in my project and I don't want to check in/commit 200 MB source codes (boost 1.42.0) into my project repository just for that. What more, my windows mobile project itself doesn't even reach 10% of that size!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于智能指针库,您有两种选择。
shared_ptr.hpp
等)。然后复制其他文件,直到项目构建(确保维护目录结构)。前者将确保添加尽可能少的文件到您的项目中。后者对于任何实质性的 boost 子集来说都要快得多,但它可能会包含许多您不需要的文件(您的程序不支持的平台的兼容性标头)。
For just the smart pointer library, you have two options.
shared_ptr.hpp
, etc.). Then copy over additional files until the project builds (make sure to maintain the directory structure).The former will make sure the fewest number of files possible gets added your project. The latter is much faster for any substantial subset of boost, but it will likely include many files you don't need (compatibility headers for platforms your program doesn't support).
只需检查包含您想要的代码的文件夹即可?尝试删除/移动/重命名“其他所有内容”,然后查看智能指针库具有哪些外部依赖项,可能不多。我几乎肯定它不需要任何内置代码(即库),因此只需检查包含的所有标头似乎是可行的方法。
Just check in the folder containing the code you want? Try deleting/moving/renaming "everything else" and see what external dependencies the smart pointer library has, probably not many. I'm almost positive it doesn't require any built code (i.e. libraries), so just checking in all of the headers that get included seems like the way to go.