Fast containers of polymorphic objects.
Maintainers
![Joaquín M López Muñoz Joaquín M López Muñoz](https://s3.us-east-2.amazonaws.com/boost.org.media/profile-images/joaquin.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIATWXBQYFTD4OW4QFM%2F20240908%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20240908T012230Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=dcb37a1f3b1b63dc7e352fb4663e6af3c808ac9b7983d5b8d62c5bcd092a41ce)
Boost PolyCollection library
Branch | Travis | AppVeyor | Regression tests |
---|---|---|---|
develop | |||
master |
Boost.PolyCollection: fast containers of polymorphic objects.
Online docs
Seminal article at bannalia.blogspot.com
Typically, polymorphic objects cannot be stored directly in regular containers and need be accessed through an indirection pointer, which introduces performance problems related to CPU caching and branch prediction. Boost.PolyCollection implements a novel data structure that is able to contiguously store polymorphic objects without such indirection, thus providing a value-semantics user interface and better performance. Three polymorphic collections are provided:
dealing respectively with classic base/derived or OOP polymorphism, function wrapping
in the spirit of std::function
and so-called
duck typing as implemented by
Boost.TypeErasure.
Requirements
Boost.PolyCollection is a header-only library. C++11 support is required. The library has been verified to work with Visual Studio 2015, GCC 4.8 and Clang 3.3.