gpt4 book ai didi

boost - 为什么Boost的`bcp smart_ptr dir/`复制6MB的源代码?

转载 作者:行者123 更新时间:2023-12-02 04:14:31 25 4
gpt4 key购买 nike

因此,我只想将智能指针与boost分开,以便在我的项目中使用,因此我被引导使用bcp实用程序。

今天,我将其编译并执行bcp smart_ptr to_copy_to_my_project/

结果:to_copy_to_my_project/目录中有6MB的代码。

你在跟我开玩笑吗?我不想仅使用智能指针就将6MB的头文件添加到我的100KB项目中。

例如,它复制以下win32内容(我在Linux上):

Copying file: boost/thread/win32/basic_timed_mutex.hpp
Copying file: boost/thread/win32/condition_variable.hpp
Copying file: boost/thread/win32/interlocked_read.hpp

当我在Linux上时,为什么要用smart_ptr复制win32内容?

也:
Copying file: boost/mpl/aux_/preprocessed/msvc60/advance_backward.hpp
...
Copying file: boost/mpl/aux_/preprocessed/msvc70/advance_backward.hpp
...
Copying file: boost/mpl/aux_/preprocessed/mwcw/advance_backward.hpp

和:
Copying file: boost/date_time/adjust_functors.hpp

为什么smart_ptr依赖于date_time?

同样,它复制了所有这些测试:
Copying file: libs/smart_ptr/test/allocate_shared_esft_test.cpp
...

我什么都不需要!我只需要smart_ptr!

我做错什么了吗?为什么它只为智能指针复制6MB的代码,我希望是10KB或20KB ...

谢谢,博达·西多(Boda Cydo)。

最佳答案

如果您只想要smart_ptr,并且对#defineBOOST_SP_USE_QUICK_ALLOCATOR(默认情况下 undefined )不感兴趣,则只需:

boost/assert.hpp
boost/checked_delete.hpp
boost/config.hpp
boost/config/compiler/*
boost/config/no_tr1/functional.hpp
boost/config/no_tr1/memory.hpp
boost/config/no_tr1/utility.hpp
boost/config/platform/*
boost/config/posix_features.hpp
boost/config/select_compiler_config.hpp
boost/config/select_platform_config.hpp
boost/config/select_stdlib_config.hpp
boost/config/stdlib/*
boost/config/suffix.hpp
boost/config/user.hpp
boost/current_function.hpp
boost/detail/interlocked.hpp
boost/detail/sp_typeinfo.hpp
boost/detail/workaround.hpp
boost/enable_shared_from_this.hpp
boost/exception/detail/attribute_noreturn.hpp
boost/exception/exception.hpp
boost/memory_order.hpp
boost/non_type.hpp
boost/shared_ptr.hpp
boost/smart_ptr/*
boost/throw_exception.hpp
boost/type.hpp

到了365k,大部分代码实际上在 boost/smart_ptr中。 boost/config中仍然有很多代码。如果知道目标平台,则可以减少 boost/config/compilerboost/config/platformboost/config/stdlib。那么绝大多数代码将在 boost/smart_ptr中。

关于boost - 为什么Boost的`bcp smart_ptr dir/`复制6MB的源代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3484585/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com