Skip to content

Commit

Permalink
Add c_str method to string to match std::string (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
opera-aberglund authored Nov 6, 2024
1 parent 1e56e01 commit 847b271
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/cista/containers/cstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ struct generic_cstring {
char* data() noexcept { return const_cast<char*>(internal_data()); }
char const* data() const noexcept { return internal_data(); }

char const* c_str() const noexcept { return data(); }

msize_t size() const noexcept { return is_short() ? s_.size() : h_.size(); }

struct heap {
Expand Down

0 comments on commit 847b271

Please sign in to comment.