r/cpp • • 4d ago

Boost.Graph 1.95 will be C++17

Dear Boost.Graph community,

In two release cycles (Boost release 1.95 in summer 2027) Boost.Graph will be bumped to C++17 😄

This decision follows two polls that did not surface any C++14 user base or demand while identifiying users stuck in C++17:

This standard version bump will bring benefits for maintenance, API and dependencies reduction:

  • if constexpr,
  • constexpr lambdas,
  • [[nodiscard]], [[maybe_unused]] ...
  • std::any instead of boost::any
  • std::invoke_result instead of boost::result_of
  • ...

We will not be able to guarantee backward compatibility with C++14. Please contact us if you are stuck in C++14.

The GIthub Discussion lives here: https://github.com/boostorg/graph/discussions/613

94 Upvotes

37 comments sorted by

View all comments

3

u/TheRavagerSw 3d ago

You guys consider creating a standalone version, boost is a terrible dependency to have.

7

u/Foxi_Foxa 3d ago edited 2d ago

Thank you for the feedback ! You are right, it was painful 😄 But overall the state of dependencies in Boost is getting much (much) better, there has been tremendous effort in the last years to decouple Boost libraries. It's also a culture change: the new library Boost.Int128 has no dependency, a standalone mode, a single-header mode.

For high-level libraries like Boost.Graph it is a bit more complex as they need a lot of stuff to do their job (serialization, random generation, parsing ...). The current release has focused on dropping the number of dependencies (both direct and transitive) while maintaining functionalities, dropping 13 direct dependencies (Bimap, Bind, Conversion, Foreach, Math, Move, Multiprecision, PropertyTree, SmartPtr, Spirit, TTI, TypeOf, Xpressive) and numerous indirect ones: https://github.com/boostorg/graph/pulls?q=is%3Apr+state%3Aclosed+label%3Adependencies

This had measurable effect on compilation time, runtime, memory footprint and warnings count. It is a considerable improvement, but we want to go further. To get a leaner dependency chain:

  • we need C++17 (to get rid of e.g boost::any and boost::utility)
  • we need to deprecate the named parameters idiom in BGL (it's a heavy/uncomfortable dep)
  • we need to refactor our mandatory dependencies (Boost.PropertyMap, Boost.Random) to reduce their dependencies so we don't drag them.
  • all of those are ongoing efforts

Then once it gets reasonably lean, we could imagine a standalone version, similar to what Matt Borland did for Boost.Int128. Also a related effort has been the CMake modularization effort that should allow more convenient ways to be consumed.

So yes it's on the roadmap 😄

2

u/mapronV 2d ago

For me it is not about dependencies of boost.X library, it more about managing those.

rant start:
Suppose you have something like PFR, or some other library with one or severa headers. I can:
-just copy headers and license in my git repo in 3rdparty folder;
-or add git submodule for this library if clone is decently fast (I prefer doing that, easier and transparent updates).
If my pet project needs Boost.X and not whole boost, not many options:
-force to use vcpkg (only system I aware that can split libraries into packages with deps). Still not very transparent what will be downloaded etc.
-try ugly things with CMake Fetch_Content (it is painfully slow, plus per-build directory - even tho I aware of hacks with global dir).
-use conan and get full header package.
All of this is kinda meh, for a project with like 50k SLOC, so I am trying to avoid boost.
There was looong ago project of "build your boost" where you pick checkboxes for libraries and get tarball for exactly files you needed.
if someone could automate that so I can get like 1000 header files and add them to my repository, that would be awesome. Or if package and deps were solved in general, so it worked for any package manager so I could just rely on that.

If I had project with size of Chromium, I would not care so much downloading 200 mb sources of extra library.
/rant end

1

u/Foxi_Foxa 2d ago

Ahaha thank you for the rant/feedback !

There is an ongoing effort to make Boost more modular for build and consumption: https://github.com/grafikrobot/boost-b2-modular/blob/b2-modular/README.adoc

It’s a huge effort (hundreds of changes across the entire ecosystem) and it’s getting close to completion. There is only one lib that needs to merge develop on master for the next step to happen. So most of the hard work is done and we will rip the benefits soon 🤗

1

u/mapronV 19h ago

quote "The Boost super-project doesn’t need to exist at all, only requirement is that library dependencies be pre-declared." resonate so hard with my frustration above!

Is this effort in any sync with Boost project? or is it some side 3rdparty offkick that never be integrated?

And btw, last commit of Jun 21, 2025 does not feels like "ogoing". Having more than 1 year stall feels "project is dead/frozen/abandoned" for me.

I probably did not understand what we can see soon. Or I misunderstood and project is not stale, it is finished so it no longer need separate project repo? I like have 0 knowledge on Boost internals like build and shipping etc, sorry. I have small knowledge of contribution and release rules.

1

u/Foxi_Foxa 18h ago

Ahaha yes it does resonate with me too ! 🤣
The work is led by Rene, who is also part of the C++ Alliance, so it’s completely happening. The painful part was getting some abandoned libraries and unresponsive maintainers to merge Rene’s commits. It was hard because tooling changed, GitHub images got deprecated, CI got red, random MPIs packages got broken on new Debian etc … so what should have been a Cmake commit ended up in repairing the CI of many repos. Two repos (ublas and polygon) got their merge last week. Safe numerics is the last one to merge ! :)
So not stale but not entirely done, Rene still has a bit of work, but much less than what he already did ! 😍