New container in Boost.PolyCollection, additions to Boost.Mp11 and more

Jan 5, 2025

During Q4 2024, I’ve been working in the following areas:

Boost.Unordered

  • Updated CI support (PR#293, PR#296, PR#297, PR#298).
  • Prepared a private document for Peter Dimov and Braden Ganetsky discussing massively parallel scenarios where ParlayHash has better performance than boost::concurrent_flat_map. We haven’t been able to progress much further than that in Q4 2024, mainly because of my lack of availablity for this specific task.
  • I’ve set up and run benchmarks comparing indivi::flat_umap with boost::unordered_flat_map. Although Indivi is generally slower, a conversation with the author led to some interesting design discussions that may be worth exploring further.
  • After the last major update in Boost 1.87.0, the backlog for Boost.Unordered is basically cleared. This means that the library will likely enter into maintenance mode, except if new requests show up —do you have any?

Boost.PolyCollection

  • Updated CI support (PR#22, PR#23).
  • Added the new boost::variant_collection container (to be released in Boost 1.88.0). boost::variant_collection_of<Ts...> is similar to std::vector<std::variant<Ts...>>, with the crucial difference that elements storing the same alternative type are grouped together. For instance, the following:
    boost::variant_collection_of<int, double, std::string> c;
    // ...
    for(const auto& v: c) {
    visit(
      [](const auto& x) { std::cout << x << "\n"; },
      v);
    }
    

    will print first the ints in the collection, then the doubles, and finally the std::strings. In exchange for this restriction, important processing speedups can be obtained.

Boost.Mp11

  • Implemented mp_lambda (released in Boost 1.87.0), a metaprogramming utility inspired by the venerable placeholder expressions from Boost.MPL. mp_lambda allows us to generate complex types specified with a rather natural syntax in terms of elementary input types indicated by Boost.Mp11 placeholder types. For instance, std::pair<_1*, _2*> can be regarded as a type template with two placeholder positions, and mp_lambda<std::pair<_1*, _2*>>::fn<int, char> is, unsurprisingly enough, the type std::pair<int*, char*>. My original motivation for writing this utility is to provide a Boost.Mp11 equivalent to Boost.MPL lambda expressions that can pave the way for an eventual modernization of Boost.Flyweight, which relies heavily on this functionality from Boost.MPL.
  • Rewritten the implementation of mp_is_set (PR#100, released in Boost 1.87.0) to achieve some rather noticeable compile-time improvements.

Boost.MultiIndex, Boost.Flyweight

  • Updated CI support (PR#75, PR#78, PR#20).
  • Investigated issue with Boost.Interprocess (#236) that was causing Boost.Flyweight tests to fail in GCC/MinGW.

Boost promotion and new website

Support to the community

  • I’ve proofread Braden Ganetsky’s article on Natvis testing.
  • As a member of the Fiscal Sponsorhip Committee (FSC), we’re having conversations with For Purpose Law Group to finalize the writing of the Boost/C++ Alliance Fiscal Sponsor Agreement (FSA), and with the Boost Foundation to help them complete the transfer of the assets to be controlled by such FSA, most importantly the ownership of the boost.org domain. Both tracks are making progress, albeit at a lower pace than desired.

All Posts by This Author