Boost
arrow_drop_down
Boost.PolyCollection
M
D

本次发布

Joaquin M. López Muñoz
Joaquin M. López Muñoz
作者

依赖项

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
贡献者
Alexander Grund
Alexander Grund
贡献者
Giovanni Mascellani
Giovanni Mascellani
贡献者