From 9fe7b9e364002e0ce1c8b75893346a53f7cceca5 Mon Sep 17 00:00:00 2001 From: opera-aberglund Date: Wed, 6 Nov 2024 11:05:21 +0100 Subject: [PATCH] Add c_str method to string to match std::string --- include/cista/containers/cstring.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/cista/containers/cstring.h b/include/cista/containers/cstring.h index 7cca3e59..7925d852 100644 --- a/include/cista/containers/cstring.h +++ b/include/cista/containers/cstring.h @@ -297,6 +297,9 @@ struct generic_cstring { char* data() noexcept { return const_cast(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 {