Comment by layer8

16 days ago

A BSTR object is compatible with functions expecting a C string. The other direction obviously never holds, unless the C string is a BSTR to start with.

Yes, there is a trade-off between slices using the same format and having compatibility with C strings. Hence “middle ground”.

You can still use a string-slice type on top of BSTR, it just would be a separate additional type. Note that languages like Java also don’t have a singular type for strings and string slices.