Skip to content

Use std::string_view in cmdlinet#9098

Draft
kroening wants to merge 2 commits into
developfrom
string_view_cmdlinet
Draft

Use std::string_view in cmdlinet#9098
kroening wants to merge 2 commits into
developfrom
string_view_cmdlinet

Conversation

@kroening

@kroening kroening commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

The strings passed as argument to the methods in cmdlinet are frequently not copied, and their address is not taken. Hence, in those cases, use std::string_view instead of std::string to relieve the caller from the burden of constructing the std::string object.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

kroening added 2 commits July 3, 2026 05:50
The strings given as arguments to the methods in levenshtein_automatont are
not copied, and their address is not taken.  Hence, a std::string_view
suffices.
The strings passed as argument to the methods in cmdlinet are frequently not
copied, and their address is not taken.  Hence, in those cases, use
std::string_view instead of std::string to relieve the caller from the
burden of constructing the std::string object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant