Mine are similar, except I don't make any guarantees about null-terminators existing within my code. They may, inadvertently be copied in from cstring, but I never assume them.
Having functions that return views and ones that returns owned strings seems troublesome to keep track off.
I moved all ownership concerns to the caller and their provided allocator to avoid that and it's working quite well.
string literal are immutable if you edit it you get UB how do you solve that ?
Mine are similar, except I don't make any guarantees about null-terminators existing within my code. They may, inadvertently be copied in from cstring, but I never assume them.
Having functions that return views and ones that returns owned strings seems troublesome to keep track off.
I moved all ownership concerns to the caller and their provided allocator to avoid that and it's working quite well.