Boost dependency for a C++ open source project?

2020-05-19 04:59发布

Boost is meant to be the standard non-standard C++ library that every C++ user can use. Is it reasonable to assume it's available for an open source C++ project, or is it a large dependency too far?

10条回答
手持菜刀,她持情操
2楼-- · 2020-05-19 05:09

Unfortunately yes, for ubuntu they're readily available but for RHEL 4&5 I've almost always ended up making them from tarballs. They're great libraries, just really big... like using a rail spike when sometimes all you really need is a thumbtack.

查看更多
家丑人穷心不美
3楼-- · 2020-05-19 05:17

KDE also depends on Boost.

However it mostly depends on your goals, and even more so on your target audience, rather than the scope of your project. for example TinyJSON (very small project), is almost 100% Boost, but thats fine because the API it provides is Boost-like and targeted at Boost programmers that need JSON bindings. However many other JSON libraries don't use Boost because they target other audiences.

On the other hand I can't use Boost at work, and I know lots of other developers (in their day jobs) are in the same boat. So I guess you could say if your Target is OpenSource, and a group that uses Boost, go ahead. If you target enterprise you might want to think it over and copy-paste just the necessary parts from Boost(and commit to their support) for your project to work.

  • Edit: The reason we can't use it at work is because our software has to be portable to about 7 different platforms and across 4 compilers. So we can't use boost because it hasn't been proven to be compatible with all our targets, so the reason is a technical one. (We're fine with the OpenSource and Boost License part, as we use Boost for other things at times)
查看更多
一夜七次
4楼-- · 2020-05-19 05:18

I would say yes. Both Mandriva (Red Hat based) and Ubuntu (Debian based) have packages for the Boost libriaries.

查看更多
虎瘦雄心在
5楼-- · 2020-05-19 05:19

I think the extensive functionality that Boost provides and, as you say, it is the standard non-standard C++ library justifies it as a dependency.

查看更多
家丑人穷心不美
6楼-- · 2020-05-19 05:21

It all depends on the way you're going to use Boost. As Diomidis said, if you're going to use some non-trivial facilities from Boost, just go ahead. Using libraries is not a crime.

Of course, there are many people who prefer not to use Boost, because introducing new dependencies has always some cons and extra worries, but in an open source project... in my opinion it's even alright to use them if you just want to learn them or improve your skills on them.

查看更多
神经病院院长
7楼-- · 2020-05-19 05:24

It depends. If you're using a header file only defined class template in Boost - then yes go ahead and use it because it doesn't suck in any Boost shared library, as all the code is generated at compile time with no external dependencies. Versioning problems are a pain for any shared c++ library, and Boost is not immune from this, so if you can avoid the problem altogether it's a good thing.

查看更多
登录 后发表回答