Boost C++ 库

...世界上最受尊敬和专业设计的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu,《C++ 编码标准

版本 1.70.0

版本 1.70.0

2019 年 4 月 12 日 06:04 GMT

文档

下载
平台文件SHA256 哈希值
unixboost_1_70_0.tar.bz2430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778
boost_1_70_0.tar.gz882b48708d211a5f48e60b0124cf5863c1534cd544ecd0664bb534a4b5d506e9
windowsboost_1_70_0.7zae2bb1b35d1f238e72e3f819b42336f4bd27c9ed2092aab5d87818ccb0c9161a
boost_1_70_0.zip48f379b2e90dd1084429aae87d6bdbde9670139fa7569ee856c8c86dd366039d
* 下载链接由 C++ 联盟 的资助支持。

已知问题

这些是库作者提供的补丁,发现得太晚而无法在发布版本中修复。请注意,它们尚未经过正常的测试流程。

新库

  • Outcome: 一套用于在不适合直接使用 C++ 异常处理的情况下报告和处理函数失败的工具,来自 Niall Douglas。
  • Histogram: 快速且可扩展的多维直方图,为 C++14 提供了便捷的接口,来自 Hans Dembinski。

更新的库

  • Asio:
    • 此版本包含许多新功能、错误修复、性能增强和文档改进。值得注意的更改包括
      • 增加了将自定义 I/O 执行器与 I/O 对象(例如套接字)一起使用的能力。
      • 添加了一个新的带有 initiate 静态成员函数的 async_result 形式。
      • 更新了 Coroutines TS 支持并将其提升到 asio 命名空间。
      • 添加了一个新的 DynamicBuffer_v2 概念,它是 CopyConstructible 的。
      • 添加了一个新的 async_compose 函数,简化了用户定义的异步操作的实现。
      • 添加了一个 make_strand 辅助函数。
      • 放宽了完成条件类型要求,仅需要移动构造性而不是复制构造性。
      • local::basic_endpoint 添加了一个接受 string_view 的构造函数。
      • 为各种函数添加了 noexcept 限定符。
      • 添加了一个新的 BOOST_ASIO_DISABLE_VISIBILITY 配置 #define
      • 启用了回收用于类型擦除多态执行器函数对象的内存。
      • 更改了接收操作,以便在数据报导向的套接字上发生截断 (error::message_size) 时返回传输的正确字节数。
      • 修复了后端使用 pthread_cond_timedwait 时绝对超时的计算。
      • 更改了基于范围的异步连接操作,以推导 EndpointSequence 迭代器类型。
      • 修复了 buffer_sequence_beginbuffer_sequence_end 以防止隐式转换。
      • 确保 SSL 握手错误在本地操作完成之前传播到对等方。
      • 抑制了 SSL 关闭时的 eof 错误,因为它实际上表示成功。
      • 添加了一个回退错误代码,用于当 OpenSSL 生成 SSL_ERROR_SYSCALL 结果而没有关联错误时。
      • 更改了组合的异步读取和写入操作以移动缓冲区序列对象。
      • 修复了 macOS 特定的关于 OSMemoryBarrier 弃用的警告。
      • 修复了在使用 MSVC 11.0 的组合读取和写入操作时发生的编译错误。
      • 改进了 dispatchpostdefer 文档。
      • 修复了使用 system_executor 时可能发生的 Windows 特定的内存泄漏。
    • 有关更多详细信息,请查阅 修订历史
  • Beast: 重大更新!!!
    • 一些 API 已经更改。
    • 参考 在每个新项目旁边显示一个星号 ★。
    • Beast 需要您的帮助!
    • 更多教程,像专业人士一样编码!
    • basic_streamtcp_stream 提供
      • 超时: async_read_someasync_write_some 在过期时完成,并返回 error::timeout!
      • 流量整形策略 simpleunlimited,或用户定义的 RatePolicy!
      • 使用 P1322R0 将 strand 直接放在套接字上,不再需要在调用站点使用 bind_executor!
    • 基类 async_basestable_async_base 并且为您处理所有组合操作样板代码。
    • ssl_stream 提供了一个可移动、可赋值的 SSL 流,具有平面写入优化。
    • 所有异步操作都使用 Asio 的 async_initiate 以便与 Coroutines TS 有效集成。
    • 更快的编译速度,在您的一个 .cpp 文件中定义 BOOST_BEAST_SEPARATE_COMPILATION#include <boost/beast/src.hpp>!
    • 有关更改的完整列表,请参阅完整的 发行说明
  • Context:
    • #91: cleanup of stack if creating ucontext fails
    • #97: add missing BOST_CONTEXT_DECL in stack_context
    • #98: fix jump_i386_sysv_macho writing garbage to the x87 control word
  • Coroutine2:
    • #28: don't crash on pthread_cancel
  • DLL:
    • New macro BOOST_DLL_USE_STD_FS. Define it to 1 to make the Boost.DLL use C++17's std::filesystem::path, std::system_error and std::error_code (#21). Note that exception types change from boost::system::system_error to std::system_error, so make sure to update catches.
    • Significant rewrite of the dynamic loadable detection and decoration logic. More precise errors are now reported in case of loading failures. Added shared_library::decorate() function that returns a decorated path to the library without doing any platform related queries and detections. Prefer using shared_library::load and shared_library constructors for better results (many thanks to Loïc Touraine for the work PR#23).
    • CI hardening, docs updates, typos fixes, cleanups and many portability fixes.
  • Dynamic Bitset:
    • Disabled hardware-assisted popcount (added in 1.69.0) on MSVC due to undefined behavior on older CPUs. (#33 PR#35)
  • Fiber:
    • #191: ignore unused argument warning
    • #196: fix high contention on remote_ready_splk_
  • Filesystem:
    • Fixed a few instances of dereferencing std::string::end() in path implementation.
    • Fixed program termination in case of out of memory condition in directory iterators constructors and operations accepting a reference to error_code. (#58)
    • Fixed possible linking errors caused by missing definitions of static members of path. (#12759)
    • Fixed possible use of uninitialized data in directory iterator increment operation on Linux.
    • Added support for movability to directory iterators.
    • Added file status query overloads for directory_entry. This avoids a relatively expensive OS query when file status is requested for a result of dereferencing a directory iterator. (PR#55)
    • Reworked current_path and read_symlink implementation to avoid possible memory exhaustion on broken or tampered with filesystems. The functions now have an internal limit of the path size they will accept from the OS, which is currently 16 MiB.
    • Increased the size of the internal buffer used by copy_file.
  • Integer:
    • Added Extended Euclidean Algorithm and Modular Multiplicative Inverse function. (Nick Thompson, PR#11)
  • Log:
    • New features
      • Added support for generating another log file name before collecting the file in the text file sink backend. This allows to combine appending to an existing log file with timestamps and file counters in log filenames, and, consequently, file collection in general.
    • See changelog for more details.
  • Math:
    • New features
      • Add Lanczos smoothing derivatives
      • Move numerical_differentiation.hpp from boost/math/tools/ to boost/math/differentiation/finite_difference.hpp.
      • Add mean, variance, skewness, kurtosis, median, Gini coefficient, and median absolute deviation to tools/univariate_statistics.hpp.
      • Add correlation coefficients and covariance to tools/bivariate_statistics.hpp
      • Add absolute Gini coefficient, Hoyer sparsity, oracle SNR, and the M[sub 2]M[sub 4] SNR estimator to tools/signal_statistics.hpp.
      • Add total variation, l0, l1, l2, and sup norms, as well as corresponding distance functions to tools/norms.hpp.
      • Add move constructors for polynomials, support complex coefficients, add .prime() and .integrate() methods.
      • Add quadratic_roots to tools/roots.hpp.
      • Add support for complex-valued functions to Newton's method in roots.hpp.
      • Add Catmull-Rom interpolator.
  • Mp11:
    • Renamed mp_invoke to mp_invoke_q
    • Added mp_similar
    • Added mp_set_union, mp_set_intersection, mp_set_difference
    • Added mp_not_fn
    • Added mp_transform_first, mp_transform_second, mp_transform_third
    • Added mp_filter
    • Added mp_eval_if_not, mp_eval_or, mp_valid_q
    • Added mp_back, mp_pop_back
  • Multi-index Containers:
    • size_type and difference_type are now defined as the allocator's same-named types. This will not make any difference in the vast majority of cases, but allows for some degree of control of resulting internal structures via user-defined allocator types (see issue #17 for motivation). For the moment being, this change is not documented in the reference section (i.e., it has semi-official status).
    • Maintenance work.
  • Multiprecision:
    • Fix various conversion issues in the traits classes, check for compatibility with Boost.Optional.
    • Prevent instantiation of std::numeric_limits on any old type when checking for convertibility. See #98.
    • Update variable precision code to account for arbitrary precision integers. See #103.
    • Add support for XML serialization archives.
    • Fix bug in fixed precision iostream formatting in mpf_float and mpfr_float. See #113.
    • Add more overloads for special functions which are better handled natively by MPFR.
    • Fixed bug in generic exp implementation which could cause invariant failure.
    • Fixed generic conversion from float to integer to avoid undefined behaviour. See #110.
  • PolyCollection:
    • Improved handling of stateful allocators and allocator propagation traits, after an error reported by Billy O'Neal (PR#9).
    • Fixed a potentially serious bug with an internal cache structure.
  • Spirit:
    • Removed use of deprecated boost/detail/iterator.hpp header. PR#432
    • X3
      • Integer parsers should now handle user defined types. PR#429
      • Note: The check_overflow trait default implementation now relies on std::numeric_limits<T>::is_bounded instead of boost::integer_traits<T>::is_integral.
      • Removed sequence into plain parsing. Now it triggers a compile time error instead of silently parsing the the sequence and taking the last value as a result. PR#439
      • Fixed parse_rule instantiation with BOOST_SPIRIT_INSTANTIATE when
        • A rule has no attribute. PR#455
        • An actual attribute is not of type a rule was declared with. PR#456 #457
      • A huge thanks goes out to Xeverous for reporting a regression in #453.
      • Fixed unneded attribute synthesization and no-transformation attribute reference pass-through in rules. #444 PR#449 PR#452
      • Removed broken 1.0#INF parser. It was poorly documented and never worked. #415 PR#458 #8699
      • The undocumented make_attribute trait was removed due to bugs PR#449 and to simplify attribute transformation. PR#460
      • If you were using it to workaround bugs in attribute transformation - they should not be needed anymore as of this release.
      • The integer value parser now respects std::numeric_limits<T>::digits10 value. PR#469
      • Fixed underflow check for a (Min % Base) == 0 corner case. PR#469
      • Fixed an output value on overflow of IgnoreOverflowDigits=true integer parser. PR#470
      • Container attribute elements were copyied, but not moved. PR#472
      • Special handling of references in transform_attribute was removed. PR#480
    • V2
      • Macro name collisions and namespace conflicts with Boost.Endian were fixed. PR#349 PR#482
      • utree
        • Fixed UB in tag getter due to left shift of negative value. PR#423
        • Fixed double-conversion (spirit::string -> std::string -> spirit::string). PR#462
      • Qi
        • Added static asserts for rule skipper type problems. PR#427
        • The check_overflow trait default implementation now relies on std::numeric_limits<T>::is_bounded instead of boost::integer_traits<T>::is_integral PR#429
        • Integer parsers should now handle user defined types. PR#429
        • Note: The check_overflow trait default implementation now relies on std::numeric_limits<T>::is_bounded instead of boost::integer_traits<T>::is_integral.
        • Removed broken 1.0#INF parser. It was poorly documented and never worked. #415 PR#458 #8699
        • The undocumented make_attribute trait was merged into transform_attribute trait. PR#471
        • The pre_transform, post_transform, and fail_transform utility functions were removed in favor of directly using pre/post/fail of the transform trait. PR#467
        • The integer value parser now respects std::numeric_limits<T>::digits10 value. PR#469
        • Fixed underflow check for a (Min % Base) == 0 corner case. PR#469
        • Fixed an output value on overflow of IgnoreOverflowDigits=true integer parser. PR#470
        • Special handling of references in transform_attribute was removed. PR#480
      • Lex
        • Fixed UB in default constructor of lexer with user specified token type. PR#420
    • Classic
      • Fixed position_iterator forming reference to local when the underlying iterator dereference operator returns a non-reference type. PR#422 #9737
  • Stacktrace:
    • Build fix for iOS 32-bit ARM (many thanks to Ivan Ponomarev for providing the fix PR#70)
    • Fixed multiple typos, warnings and updated the docs.
  • Test:
    • Boost.test v3.10 see the Changes log for more details.
    • Breaking changes
      • Boost.Test minimal.hpp is now showing a deprecation warning,
      • Change in floating point comparison may fail tests that were silently not using the floating point comparison logic prior to this release,
      • Internal API change to unit_test_log_formatter, see detailed change log,
    • New feature
      • Floating point comparison has been extended to capture non-floating point and arithmetic operands: expressions like BOOST_TEST(3.0001 == 3) now use floating point support of Boost.Test,
      • Custom datasets are not required to declare the sample type field anymore,
      • Extending template test cases from std::tuple to any variadic definition,
      • Windows support for timed tests,
      • Timed test on test-suites,
      • Removed dependency to Boost.Timer,
      • New macro BOOST_TEST_INFO_SCOPE for scoped context declaration,
      • Improved BOOST_TEST_CONTEXT syntax
    • Bug fixes and pull requests
  • TypeIndex:
    • Support for the GHS C++ compiler added (many thanks to Brandon Castellano for providing the patch PR#28)
    • Optimized string and type comparisons (many thanks to Andrey Semashev for providing the patch PR#23)
    • Fixed clang-win compilation (many thanks to Peter Dimov for providing the patch PR#25)
    • CI hardening.
  • TypeTraits:
    • Added is_bounded_array and is_unbounded_array (Glen Fernandes).
    • Added copy_reference and copy_cv_ref (Glen Fernandes).
    • Improved support for msvc with /clr option.
    • Misc compiler compatibility fixes.
  • Variant:
    • Many cleanups and internal improvements, many thanks to Nikita Kniazev (PR#55, PR#56, PR#57) and Louis Dionne (PR#51)
    • CI hardening.
  • uBlas:
    • Addition of tensor framework (many thanks to Cem Bassoy PR#65)
    • Addition of basic OpenCL support (many thanks to Fady Essam PR#59)
    • Integration of basic benchmark suite (many thanks to Stefan Seefeld PR#57)
    • CI integration and hardening

测试的编译器

Boost 的主要测试编译器是

  • Linux
    • Clang: 3.0, 4.0.1, 6.0.1
    • Clang, C++0x: 3.0
    • Clang, C++11: 3.0, 3.1, 3.2, 3.3, 3.4, 4.0.1, 6.0.1, 7.0.0, 8.0.0
    • Clang, C++14: 3.5.0, 3.6.0, 3.7.1, 3.8.0, 3.9.1, 4.0.0, 4.0.1, 5.0.2, 6.0.1, 7.0.0, 8.0.0
    • Clang, C++17: 5.0.2, 6.0.1, 7.0.0, 8.0.0
    • GCC: 4.4.7, 4.5.3, 4.6.3, 5.4.0, 8.0.1
    • GCC, C++0x: 4.4.7
    • GCC, C++11: 4.7.3, 4.8.5, 4.9.4, 5.4.0, 6.4.0, 7.1.0, 8.0.1
    • GCC, C++14: 5.4.0, 5.5.0, 6.4.0, 7.1.0, 7.3.0, 8.0.1
    • GCC, C++17: 7.3.0, 8.0.1
    • Intel, C++14: 18.0
  • OS X
    • Apple Clang: 9.0.0, 9.1.0, 10.0.0
    • Apple Clang, C++11: 9.0.0, 9.1.0, 10.0.0
    • Apple Clang, C++14: 9.0.0, 9.1.0, 10.0.0
    • Apple Clang, C++17: 9.1.0, 10.0.0
    • Apple Clang, C++1z: 9.0.0
    • Apple Clang, C++2a: 10.0.0
  • Windows
    • GCC: 3.4.5, 4.1.2, 4.2.4, 4.3.3, 4.4.0, 4.5.4
    • GCC, C++0x: 4.6.4
    • GCC, C++11: 4.7.3, 4.8.1, 4.9.3
    • GCC, C++14: 5.1.0, 5.2.0, 5.3.0, 6.1.0, 6.2.0, 6.3.0, 6.4.0
    • GCC, C++17: 7.1.0, 7.2.0, 7.3.0
    • Visual C++: 7.1, 8.0, 9.0, 10.0, 11.0, 12.0, 14.0, 14.1
  • FreeBSD
    • Clang: 4.0.0
    • Clang, C++11: 4.0.0
    • Clang, C++14: 4.0.0
    • Clang, C++1z: 4.0.0

Boost 的其他测试编译器包括

  • Linux
    • Clang: 3.0, 3.8.1, 3.9.1, 4.0.1, 5.0.2, 6.0.1
    • Clang, C++0x: 3.0
    • Clang, C++11: 3.0, 3.1, 3.2, 3.3, 3.4, 4.0.1, 6.0.1, 7.0.0, 8.0.0
    • Clang, C++14: 3.5.0, 3.6.0, 3.7.1, 3.8.0, 3.9.1, 4.0.0, 4.0.1, 5.0.2, 6.0.1, 7.0.0, 8.0.0
    • Clang, C++17: 5.0.2, 6.0.1, 7.0.0, 8.0.0
    • GCC: 4.4.7, 4.5.3, 4.6.3, 4.9.4, 5.4.0, 5.5.0, 8.0.1
    • GCC, C++0x: 4.4.7
    • GCC, C++11: 4.7.3, 4.8.5, 4.9.4, 5.4.0, 6.4.0, 7.1.0, 8.0.1
    • GCC, C++14: 5.4.0, 5.5.0, 6.3.0, 6.4.0, 7.1.0, 7.3.0, 8.0.1, 8.1.0
    • GCC, C++17: 7.3.0, 8.0.1
    • Intel, C++14: 18.0
  • OS X
    • Apple Clang: 9.0.0, 9.1.0, 10.0.0
    • Apple Clang, C++11: 9.0.0, 9.1.0, 10.0.0
    • Apple Clang, C++14: 9.0.0, 9.1.0, 10.0.0
    • Apple Clang, C++17: 9.1.0, 10.0.0
    • Apple Clang, C++1z: 9.0.0
    • Apple Clang, C++2a: 10.0.0
  • Windows
    • GCC: 3.4.5, 4.1.2, 4.2.4, 4.3.3, 4.4.0, 4.5.4
    • GCC, C++0x: 4.6.4
    • GCC, C++11: 4.7.3, 4.8.1, 4.9.3
    • GCC, C++14: 5.1.0, 5.2.0, 5.3.0, 6.1.0, 6.2.0, 6.3.0, 6.4.0
    • GCC, C++17: 7.1.0, 7.2.0, 7.3.0
    • Visual C++: 7.1, 8.0, 9.0, 10.0, 11.0, 12.0, 14.0, 14.1
  • FreeBSD
    • Clang: 4.0.0
    • Clang, C++11: 4.0.0
    • Clang, C++14: 4.0.0
    • Clang, C++1z: 4.0.0

鸣谢

Daniel James、Vladimir Prus、Marshall Clow 和 Michael Caisse 管理了此版本。