From 847b27100b7e730370b810ce62206a66b0bf2d79 Mon Sep 17 00:00:00 2001 From: Alex Berglund <107394376+opera-aberglund@users.noreply.github.com> Date: Wed, 6 Nov 2024 11:16:28 +0100 Subject: [PATCH] Add c_str method to string to match std::string (#238) --- include/cista/containers/cstring.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/cista/containers/cstring.h b/include/cista/containers/cstring.h index 7cca3e59..1a6d26da 100644 --- a/include/cista/containers/cstring.h +++ b/include/cista/containers/cstring.h @@ -297,6 +297,8 @@ struct generic_cstring { char* data() noexcept { return const_cast(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 {