diff --git a/include/nameof.hpp b/include/nameof.hpp index 1f854f2..9b8ac24 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -166,9 +166,15 @@ class [[nodiscard]] cstring { [[nodiscard]] constexpr const char* c_str() const noexcept { return data(); } + template, typename Allocator = std::allocator> + [[nodiscard]] std::basic_string to_string() const { return {begin(), end()}; } + [[nodiscard]] constexpr operator std::string_view() const noexcept { return {data(), size()}; } [[nodiscard]] constexpr explicit operator const char*() const noexcept { return data(); } + + template, typename Allocator = std::allocator> + [[nodiscard]] explicit operator std::basic_string() const { return {begin(), end()}; } }; template