Skip to content

Commit

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

char* c_str() noexcept { return 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 9fe7b9e

Please sign in to comment.