如何仅在项目中包含BOOST智能指针代码? [英] How to include only BOOST smart pointer codes into a project?

查看:90
本文介绍了如何仅在项目中包含BOOST智能指针代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅在不将所有Boost库添加到项目中的情况下仅包含Boost智能指针库的最佳实践是什么?

What are best practices to include boost smart pointer library only without adding all boost libraries into the project?

我只想在项目中使用boost智能指针库,而我不想为此而将 200 MB 源代码(升级到1.42.0)签入/提交到我的项目存储库中.而且,我的Windows Mobile项目本身甚至没有达到该大小的10%!

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!

推荐答案

仅对于智能指针库,您有两个选择.

For just the smart pointer library, you have two options.

  1. 复制包含在源文件中的标头(shared_ptr.hpp等).然后复制其他文件,直到构建项目为止(确保维护目录结构).
  2. 使用增强功能 bcp 公用事业.对于较大的子集,此工具可节省大量时间.
  1. Copy the headers you include in your source files (shared_ptr.hpp, etc.). Then copy over additional files until the project builds (make sure to maintain the directory structure).
  2. Use the boost bcp utility. For larger subsets, this tool saves a ton of time.

前者将确保将最少数量的文件添加到您的项目中.对于boost的任何实质性子集,后者要快得多,但是它可能包含许多不需要的文件(程序不支持的平台的兼容性标头).

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).

这篇关于如何仅在项目中包含BOOST智能指针代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆