Skip to content

Conversation

thomashampson
Copy link
Contributor

@thomashampson thomashampson commented Oct 30, 2024

Description of work

Since our move to C++20, the string functions starts_with and ends_with are now available as part of std::string. Here we replace all instances of the boost equivalents. Note that the case insensitive versions (istarts_with and iends_with) have not been replaced because there isn't a suitable STL alternative.

Summary of work

Things that had to be done as part of this work:

  • replace the boost ends_with and starts_with with the STL versions
  • remove the headers from places where they're not needed
  • add headers to places where they are needed
  • fix cppcheck defects where the lines numbers have changed w.r.t. the suppressions file

There is no associated issue.

To test:

Check that the changes are all sensible. Check the codebase for any missed instances of boost::algorithm::starts_with or boost::algorithm::ends_with.

This does not require release notes because it's code maintenance.


Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@thomashampson thomashampson force-pushed the use_stl_string_functions branch from d4976a0 to 8ac602a Compare October 30, 2024 17:49
@thomashampson thomashampson force-pushed the use_stl_string_functions branch from 8ac602a to f18761b Compare October 31, 2024 09:41
@thomashampson thomashampson added ISIS: Core Issue and pull requests at ISIS that relate to Core features and functions Maintenance Unassigned issues to be addressed in the next maintenance period. labels Oct 31, 2024
@thomashampson thomashampson added this to the Release 6.12 milestone Oct 31, 2024
@thomashampson thomashampson marked this pull request as ready for review October 31, 2024 11:49
jhaigh0
jhaigh0 previously approved these changes Oct 31, 2024
@robertapplin robertapplin self-assigned this Oct 31, 2024
Copy link
Contributor

@robertapplin robertapplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement to the code, just had a few quick questions

@robertapplin robertapplin merged commit 1df61a4 into main Nov 1, 2024
10 checks passed
@robertapplin robertapplin deleted the use_stl_string_functions branch November 1, 2024 10:01
peterfpeterson pushed a commit to peterfpeterson/mantid that referenced this pull request Dec 5, 2024
This is a squashed version of mantidproject#38329

Use iends_with for consistency with the rest of the file.

Update dev docs regarding string libraries

Replace boost starts_with with stl equivalent

Add boost headers where they're required

Use to std::string to avoid using boost starts_with

fix cppcheck defects

Add missing boost headers to tests

Make strings const.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ISIS: Core Issue and pull requests at ISIS that relate to Core features and functions Maintenance Unassigned issues to be addressed in the next maintenance period.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants