Using Boost unordered_map

本秂侑毒 提交于 2019-12-18 07:03:44

问题


I want to include boost::unordered_map in my project without downloading the whole Boost package. How can I do that?


回答1:


Use bcp: http://www.boost.org/doc/libs/1_52_0/tools/bcp/doc/html/index.html

cd $BOOST_DIR
bcp unordered_map /tmp/TEST

Now /tmp/TEST contains only the things required for unordered_map, in my case 15Mb (as opposed to 734Mb for the full boost library)




回答2:


You need at least headers because Boost packages depend on each other. You might want to select only needed header files but it will really be pain in the neck and will take you many hours. The algorithm is:

  1. Include only boost/unordered_map.
  2. While preprocessor complains about header that is not found:
    • Add that header.
    • Recompile.

You will end up with only necessary headers. But I can't see any advantages of this solution.



来源:https://stackoverflow.com/questions/13418918/using-boost-unordered-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!