为什么使用boost增加文件大小的这么多? [英] Why does using boost increase file size so much?

查看:153
本文介绍了为什么使用boost增加文件大小的这么多?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,当我使用一个增强功能的应用程序的大小往往由约0.1增加 - 0.3 MB。这看起来好像不是很多,但相对于使用其他外部库是(至少对我来说)。这是为什么?

I've noticed that when I use a boost feature the app size tends to increase by about .1 - .3 MB. This may not seem like much, but compared to using other external libraries it is (for me at least). Why is this?

推荐答案

升压使用模板处处。这些模板可以用相同的参数来多次实例化。一个足够聪明的连接器将抛出所有,但一个副本。然而,并非所有的接头是足够聪明。此外,模板隐式实例化,有时,它是很难知道一个人多少次被实例化。

Boost uses templates everywhere. These templates can be instantiated multiple times with the same parameters. A sufficiently smart linker will throw out all but one copy. However, not all linkers are sufficiently smart. Also, templates are instantiated implicitly sometimes and it's hard to even know how many times one has been instantiated.

这篇关于为什么使用boost增加文件大小的这么多?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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