I've noticed how in C++11, C++14 and onward, more and more Boost libraries are adopted/incorporated into the actual language standard (or into TS documents, which are likely to end up as part of the standard): Boost.optional, Boost.Any, Boost's threading library, smart pointers, etc. etc.
Are these libraries now maintained solely for usage with C++ code using an older version of the language standard, or do they have additional use? Specifically, are some of them considered alternative semantic variants to the choices of the C++ standards bodies?
One difference between the Boost and standard versions is that Boost may have deprecated functionality (design aspects that were decided after discussion and experience to be problematic, and so weren't added to the standard) or extensions to the standard (because Boost may have more flexibility than the standard and so has features that didn't make it into the standard).
For example, Boost.Thread's documentation lists several deprecations and extensions compared to the standard library.
Depending on your needs, these may be good reasons to go with Boost over the standard.
I don't work for/on the Boost project, but yes, I expect that these features will for some foreseeable future be maintained, so that those who use an older standard for whatever reason (Common reasons are "the whole project is written in C++03" or "We have been using compiler X version A.B.C and we worry about testing with a new compiler version D.E.F"). The more "customers" you have for a project, the more important it becomes to update things gradually, and not change old behaviour unless absolutely necessary or remove old features.
It is of course still possible to use these features even in "modern C++" applications that use C++11 or C++14 (and sometimes they have subtly different semantics and/or syntax, so the change required to use the "modern C++" variant is more than "remove the #include
of that boost"). Just because there is a new way to do something doesn't mean that all code-writers IMMEDIATELY change all their code to use that way... So using the "old" way will still happen and exist for quite some time after it has been adopted. And sometimes there are subtle differences that require further alterations to the source code, so more "thinking/typing" needed, which means the change is less likely to happen. If it's just a "replace boost::thread
with std::thread
" then it may happen quite quickly. If you also need to change some other code involved (arguments change order, the syntax/meaning of things subtly change, etc), then it's more of a "proper work to solve this", which usually means it gets lower priority in the development team (especialy if it's also "not giving much in the way of benefit")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With