With C++17 now published, even more of Boost's libraries are now covered by the standard library: optional, variant, any, ASIO (in the Networking TS), coroutines (in a TS) and more. This, in addition to the gobs and gobs of Boost stuff already in the standard, see this answer. I realize that some of the standardized versions have slightly different design space choices than Boost's, but essentially it's the same.
Given this fact, are there or have there been plans to release an alternative version (or just - a new mainline version) of Boost which:
?
If not - is this because of the importance of the Boost design choices? Too much hassle? Fear of "project bifurcation"?
Note: This is an informative question, so please don't provide your opinion or whether this would be a good idea or not.
Most utilities from the Fundamentals TS were merged into C++17, but Boost. Container offers them for C++03, C++11 and C++14 compilers.
Boost has been used in C++03 for years, so its the natural choice to use boost versions still in C++11 which are now part of std::, in order to be able to interface with C++03. But also some people will be happy to use C++11, and prefer the Standard Library over using boost.
You can check version. hpp inside Boost include dir (normally /usr/include/boost , you can use locate /boost/version. hpp or similar to get that) for BOOST_VERSION or BOOST_LIB_VERSION .
Boost is a set of libraries for the C++ programming language that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It contains 164 individual libraries (as of version 1.76). Boost. Boost logo.
Boost has better implementation than many currently existing implementations of standard C++ library.
Note that:
<filesystem>
Windows has no support for Unicode in both C/C++ runtimes e.g. you cannot switch standard library to Unicode-aware narrow character set (UTF-8). As the result std::filesystem::path
always assumes non-unicode encoding when used with char
sequences. There is std::filesystem::u8path
for this, but writing std::filesystem::path p = some_char_sequence
imo is way too easy. Any codebase that uses std::filesystem
and supports Windows will have to battle this constantly.
Boost.Filesystem allowed user to specify locale to be used for path
objects. Boost.Locale could be used to create UTF-8 locale on Windows, eliminating this issue. Std.filesystem does not allow you to do this.
<system_error>
On Linux with glibc:
std::error_category::message
is not thread safe, although it should be. Boost.System at least tries to provide thread-safe implementation for every platform.On Windows (MSVC) it is broken in multiple places:
std::system_category
have annoying "\r\n" at the end, which does not happen anywhere else. Boost.System explicitly trims those.std::error_category
does not work for generic and system categories if used cross-dll. Boost.System never had this issue.std::atexit
. When category is accessed for the first time from another atexit
handler. This might be a problem and can cause deadlocks (as any implicit locking). I had experience with this in the past.The sad part about <system_error>
is that <filesystem>
and future networking library (ASIO) both rely on it heavily, so both get a little bit broken on Windows.
<mutex>
, <condition_variable>
, <shared_mutex>
.Until recently on Windows and MSVC std::condition_variable
and std::mutex
could cause deadlock when instantiated in a dll due to using lazy initialization internally. With MSVC14 (Visual Studio 2015) this should be fixed at least for std::mutex
since it was rewritten to use SRW locks internally, but I am not sure about condition variables. MSVC12 (Visual Studio 2013) definitely has a lot of bugs here.
If you need a reader-writer lock, it might be very important to know if it favors readers or writers. Standard std::shared_mutex
does not allow you to specify this behavior and according to the original proposal this was done because there is an algorithm that allows implementation to favor neither and try to prevent starvation of both (somewhat "fair" lock). Original implementation e.g. boost::shared_mutex
follows this algorithm and is not based on pthread_rwlock_t
(which usually favors readers due to requirements of POSIXas std::shared_mutex
. Imo this means std::shared_mutex
has a poor implementation on many systems. Although Boost implementation is not the fastest one either.
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