Boost
arrow_drop_down
Boost.PolyCollection
M
D

本次发布

Joaquin M. López Muñoz
Joaquin M. López Muñoz
作者
Alexander Grund
Alexander Grund
贡献者

依赖项

Boost PolyCollection 库

Branch CI Drone status Build status Deps Documentation Enter the Matrix
Branch CI Drone status Build status Deps Documentation Enter the Matrix
BSL 1.0 C++11 required Header-only library

Boost.PolyCollection:用于多态对象的快速容器。

通常,多态对象不能直接存储在常规容器中,而需要通过间接指针访问,这会导致与 CPU 缓存和分支预测相关的性能问题。Boost.PolyCollection 实现了一个新颖的数据结构,能够连续存储多态对象而无需此类间接访问,从而提供值语义的用户界面和更好的性能。提供了四种多态容器

分别处理经典的基类/派生类或 OOP 多态性,以 std::function 精神进行函数包装,所谓的鸭子类型(由Boost.TypeErasure实现),以及类似 variant 的封闭多态性

了解 Boost.PolyCollection

安装 Boost.PolyCollection

  • 下载 Boost 即可开始使用(这是一个仅头文件库,无需编译)。
  • 使用 Conan 2:如果您还没有安装,请在您的 conanfile.txt 中添加 Boost 条目(示例要求至少 Boost 1.86)
[requires]
boost/[>=1.86.0]
    如果您不使用任何编译的 Boost 库,以下操作将跳过编译
[options]
boost:header_only=True
  • 使用 vcpkg:执行命令
vcpkg install boost-poly-collection

支持

贡献

全部时间

Rene Rivera
Rene Rivera
贡献者
Peter Dimov
Peter Dimov
贡献者
Tinko Bartels
Tinko Bartels
贡献者
Giovanni Mascellani
Giovanni Mascellani
贡献者