Replace more boost by std functions - #1762
Open
pecalvop wants to merge 19 commits into
Open
Conversation
pecalvop
marked this pull request as ready for review
September 4, 2026 13:05
pecalvop
requested review from
aaadelmann and
gsell
and
a lite review from Copilot
and removed request for
Copilot
September 4, 2026 13:05
gsell
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1727
I've put each boost replacement in a separate commit to make it easier to track.
Overview
This pull request continues the removal of Boost dependencies from the legacy OPAL codebase.
The remaining Boost functionality is replaced with equivalent C++ standard library functionality or, where no direct standard-library replacement is available, with small self-contained implementations.
The main objectives are to:
Main changes
Boost iostreams
Boost iostreams dependencies have been removed where standard C++ streams provide the required functionality.
String algorithms
Boost string algorithms have been replaced with standard C++ facilities.
In particular,
boost::ilexicographical_compareis replaced using:std::lexicographical_comparestd::tolowerThis preserves the case-insensitive lexical comparison while removing the dependency on Boost string algorithms.
Type information
boost::type_indexhas been removed in favour of standard C++ type facilities.Numeric casts
Uses of
boost::numeric_casthave been replaced with explicit standard C++ casts, primarily usingstatic_cast.Chebyshev polynomials
The Boost Chebyshev polynomial functionality has been replaced by a local implementation.
This avoids introducing an additional Boost dependency for a relatively small and specialised numerical operation.
Filesystem
boost::filesystemhas been replaced bystd::filesystem.This removes both the Boost filesystem headers and the corresponding Boost library dependency.
Formatting
boost::formathas been removed and replaced with standard C++ stream-based formatting or equivalent standard-library functionality.Timers
The Boost timer dependency has been removed.
The existing IPPL timing infrastructure continues to provide timer creation, measurement, accumulation and reporting without relying on Boost Timer.
The timing output sorting has also been migrated away from Boost string comparison utilities.
Function objects
Remaining uses of
boost::functionhave been replaced withstd::function.This removes another Boost-specific interface in favour of the C++ standard library.
Optimizer parser
The optimizer expression/parser infrastructure has been cleaned up to remove remaining Boost dependencies.
The affected components include:
The existing parser functionality is retained while reducing the dependency on Boost.
Serialization
Boost Serialization and Boost Archive dependencies have been removed from the remaining optimizer code.
The affected solution-state and communication code has been adapted so that Boost Serialization is no longer required.
MPI and optimizer communication
The optimizer communication layer has been cleaned up as part of the Boost removal.
Affected components include:
MasterNode;SolutionStateIO;MPIHelper;AsyncSendBuffers;MPI communication is now based on MPI and standard C++ types rather than Boost wrappers.
CMake changes
The Boost component requirements have been reduced accordingly.
Previously, the build configuration required: