10000 Mark member functions of `string_view_nt` as `const` by tobiolo · Pull Request #899 · aardappel/treesheets · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Mark member functions of string_view_nt as const #899

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ struct string_view_nt {
string_view_nt(const string &s) : sv(s) {}
explicit string_view_nt(const char *s) : sv(s) {}
explicit string_view_nt(string_view osv) : sv(osv) { check_null_terminated(); }
void check_null_terminated() { assert(!sv.data()[sv.size()]); }
void check_null_terminated() const { assert(!sv.data()[sv.size()]); }
size_t size() const { return sv.size(); }
const char *data() const { return sv.data(); }
const char *c_str() {
const char *c_str() const {
check_null_terminated(); // Catch appends to parent buffer since construction.
return sv.data();
}
Expand Down
0