Skip to content

Conversation

@leejkee
Copy link
Contributor

@leejkee leejkee commented Oct 21, 2025

Refactor: Pass std::string_view by value instead of by const reference

Closes #1259.

As discussed in Issue #1259 , this PR refactors the codebase to pass std::string_view by value (e.g., std::string_view) instead of by const std::string_view&.

Changes Made

  • Updated HeaderCallback's std::function and operator() to use std::string_view.
  • Updated DebugCallback's std::function and operator() to use std::string_view.
  • Updated WriteCallback's std::function and operator() to use std::string_view.
  • Updated relevant unit tests to use std::string_view in their lambda signatures.

Copy link
Member

@COM8 COM8 left a comment

Choose a reason for hiding this comment

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

Approved. Thanks @leejkee for your work!

@COM8 COM8 merged commit 62cb469 into libcpr:master Oct 25, 2025
33 of 37 checks passed
@COM8 COM8 added this to the CPR 1.13.0 milestone Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Pass std::string_view by value instead of by const reference

2 participants