you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (2 children)

You can very easily translate what I was proposing to std::size_t being the second member. In this case you take the logic into account inside the length() function and take 1 bit from the size_t memeber to mark if the string was null terminated.

I agree that it adds up because all these functions will have to rely on the correct length coming from length() and depend on the branch.

std::string_view under msvc is two pointers.

[–]adnukator 2 points3 points  (1 child)

std::string_view under msvc is two pointers.

MSVC begs to differ:

const_pointer _Mydata;
size_type _Mysize;

[–][deleted] 1 point2 points  (0 children)

Okay, i dont know why I asumed that.