为什么Boost的`BCP smart_ptr DIR /`源$ C ​​$ C副本6MB? [英] Why did Boost's `bcp smart_ptr dir/` copy 6MB of source code?

查看:115
本文介绍了为什么Boost的`BCP smart_ptr DIR /`源$ C ​​$ C副本6MB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我想从助推分离出来仅仅是智能指针在我的项目中使用,我被引导到使用 BCP 工具。

So I wanted to separate out just the smart pointers from boost to use in my project and I was guided to use bcp utility.

今天,我把它编译并做 BCP smart_ptr to_copy_to_my_project /

Today I got it compiled and did bcp smart_ptr to_copy_to_my_project/.

其结果是:在code的6MB to_copy_to_my_project / 目录

The result: 6MB of code in to_copy_to_my_project/ directory.

你在开玩笑吧?我不想的头文件6MB添加到我的100KB的项目只是为了使用智能指针。

Are you kidding me? I don't want to add 6MB of header files to my 100KB project just to use smart pointers.

例如,它复制下面的Win32的东西(我在Linux上):

For example, it copies the following win32 stuff (I am on 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

为什么会复制win32的东西与smart_ptr当我在Linux呢?

Why would it copy win32 stuff with smart_ptr when I am on Linux?

还有:

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?

Why does smart_ptr depend on date_time?

还有什么关于所有这些测试,它复制:

Also what about all these tests that it copied over:

Copying file: libs/smart_ptr/test/allocate_shared_esft_test.cpp
...

我不需要任何的吧!我只需要smart_ptr!

I don't need any of it! I just need smart_ptr!

难道我做错了什么?为什么把它复制code的6MB只是为智能指针,而我希望是10KB或20KB ...

Did I do something wrong? Why did it copy 6MB of code just for the smart pointers, which I would expect to be 10KB or 20KB...

谢谢,博大Cydo。

推荐答案

如果你想要的是 smart_ptr 和你不感兴趣的#定义'ING BOOST_SP_USE_QUICK_ALLOCATOR (这不是默认定义),你只需要:

If all you want is smart_ptr and you're not interested in #define'ing BOOST_SP_USE_QUICK_ALLOCATOR (which is not defined by default), you only need:

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,在大头code实际上是升压/ smart_ptr 。还有在升压/配置很多code的。如果你知道你的目标是什么平台,你可以大肆削减升压/配置/编译升压/配置/平台升压/配置/ STDLIB 。然后,绝大多数code的将是升压/ smart_ptr

This comes to 365k, with the bulk of the code actually in boost/smart_ptr. There is still a lot of code in boost/config. If you know what platforms you're targeting, you could pare down boost/config/compiler, boost/config/platform, and boost/config/stdlib. Then the vast majority of the code would be in boost/smart_ptr.

这篇关于为什么Boost的`BCP smart_ptr DIR /`源$ C ​​$ C副本6MB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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