使用STL会显着增加占用空间吗? [英] Does using STL increase footprint significantly?

查看:114
本文介绍了使用STL会显着增加占用空间吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用STL会显着增加占用空间吗?你能分享一下你的经验吗?

Does using STL increase footprint significantly? Could you guys share your experience regarding this matter? What are the best practices to build a small footprint library?

推荐答案

由于STL是一组模板,因此没有一个答案。模板,由于它们的本质,只有在使用时才编译。因此,您可以包括所有的STL,如果没有实际使用,则由STL添加的足迹将为零。如果你有一个非常小的应用程序,管理使用许多不同的模板与不同的专业,足迹可能很大。

There's no one answer since STL is a set of templates. Templates, by their very nature, are only compiled in when used. So you can include all of STL and if none of it is actually used, the footprint added by STL will be zero. If you have a very small app that manages to use a lot of different templates with different specializations, the footprint can be large.

这篇关于使用STL会显着增加占用空间吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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