Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using std::string_view #98

Open
methylDragon opened this issue Jul 26, 2024 · 0 comments
Open

Using std::string_view #98

methylDragon opened this issue Jul 26, 2024 · 0 comments

Comments

@methylDragon
Copy link

methylDragon commented Jul 26, 2024

The established pattern in warehouse_ros is to pass const std::string& to prevent a copy.

However this prevents use of the more modern std::string_view in code building on top of warehouse_ros, forcing them to copy into an std::string just to call into methods of warehouse_ros (when a copy would've been prevented in the first place!).

Since we moved to C++17 in Galactic, which supports std::string_view, we probably should move to using std::string_view instead.

I'm not sure if there are any issues with just doing a sweeping find and replace though, for anyone depending on warehouse_ros?

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

No branches or pull requests

1 participant