# poly_collection
**Repository Path**: axylp/poly_collection
## Basic Information
- **Project Name**: poly_collection
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: develop
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-03-06
- **Last Updated**: 2025-03-06
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Boost PolyCollection library
[](https://github.com/boostorg/poly_collection/tree/master) [](https://github.com/boostorg/poly_collection/actions/workflows/ci.yml) [](https://drone.cpp.al/boostorg/poly_collection) [](https://ci.appveyor.com/project/joaquintides/poly-collection/branch/master) [](https://pdimov.github.io/boostdep-report/master/poly_collection.html) [](https://www.boost.org/doc/libs/master/doc/html/poly_collection.html) [](http://www.boost.org/development/tests/master/developer/poly_collection.html)
[](https://github.com/boostorg/poly_collection/tree/develop) [](https://github.com/boostorg/poly_collection/actions/workflows/ci.yml) [](https://drone.cpp.al/boostorg/poly_collection) [](https://ci.appveyor.com/project/joaquintides/poly-collection/branch/develop) [](https://pdimov.github.io/boostdep-report/develop/poly_collection.html) [](https://www.boost.org/doc/libs/develop/doc/html/poly_collection.html) [](http://www.boost.org/development/tests/develop/developer/poly_collection.html)
[](https://www.boost.org/users/license.html)
**Boost.PolyCollection**: fast containers of polymorphic objects.
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](http://www.boost.org/doc/html/poly_collection/an_efficient_polymorphic_data_st.html)
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:
* [`boost::base_collection`](http://www.boost.org/doc/html/poly_collection/tutorial.html#poly_collection.tutorial.basics.boost_base_collection)
* [`boost::function_collection`](http://www.boost.org/doc/html/poly_collection/tutorial.html#poly_collection.tutorial.basics.boost_function_collection)
* [`boost::any_collection`](http://www.boost.org/doc/html/poly_collection/tutorial.html#poly_collection.tutorial.basics.boost_any_collection)
dealing respectively with classic base/derived or OOP polymorphism, function wrapping
in the spirit of `std::function` and so-called
[*duck typing*](https://en.wikipedia.org/wiki/Duck_typing) as implemented by
[Boost.TypeErasure](http://www.boost.org/libs/type_erasure).
## Learn about Boost.PolyCollection
* [Online docs](http://boost.org/libs/poly_collection)
* [Seminal article at bannalia.blogspot.com](http://bannalia.blogspot.com/2014/05/fast-polymorphic-collections.html)
## Install Boost.PolyCollection
* [Download Boost](https://www.boost.org/users/download/) and you're ready to go (this is a header-only library requiring no building).
* Using Conan 2: In case you don't have it yet, add an entry for Boost in your `conanfile.txt` (the example requires at least Boost 1.86):
```
[requires]
boost/[>=1.86.0]
```