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

Fix readbility-qualified-auto #1725

Closed

Conversation

jfsimoneau
Copy link
Contributor

No description provided.

httplib.h Outdated
@@ -2216,7 +2216,7 @@ inline bool from_hex_to_i(const std::string &s, size_t i, size_t cnt,
}

inline std::string from_i_to_hex(size_t n) {
static const auto charset = "0123456789abcdef";
static const auto *const charset = "0123456789abcdef";
Copy link
Owner

Choose a reason for hiding this comment

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

Adding const is ok, but I don't like to leave *, since I do the same for shared pointers as below.

auto mm = std::make_shared<detail::mmap>(path.c_str());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the second case. mm is not a raw pointer, though. Here, I could change the pointer to either a C-style array or an std::array. I'll try a few things to see which one would be more elegant and still be compliant.

Copy link
Owner

Choose a reason for hiding this comment

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

My saying is that I would like to keep the code as always using just auto regardless of regular value, raw pointer or managed pointer (std::shared_ptr, std::unique_ptr). Thanks for your effort, but I'l close it. :)

@yhirose yhirose closed this Nov 24, 2023
@jfsimoneau jfsimoneau deleted the fix-readbility-qualified-auto branch November 24, 2023 14:07
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.

2 participants