vonosmas wrote:

> I very much think this is the wrong direction. Using span / string_view style 
> types rather than raw pointer / size pairs is something I really think we 
> should aspire to stick to and move more outlier code towards. 
> `cpp::string_view` is a polyfill for `std::string_view`, which is already 
> actually just `std::basic_string_view<char>`; it's easy enough to templatize 
> the polyfill as well and I don't see why we wouldn't just do that.
> 
> In the long run, more Hand-in-Hand work with libc++ will probably give us 
> fuller string_view / span implementations to use directly in our hermetic 
> namespace without reimplementing them all ourselves as we have now in 
> `__support`. So I think putting a bit more work into our `cpp::*` types 
> now--in the direction of being more faithful and complete polyfills of 
> `std::*` counterparts--is not a slippery slope of complicating maintenance, 
> but a sensible interim approach that just further motivates our established 
> long-term intent to collaborate more extensively with libc++ on 
> implementation sharing.
> 
> On the contrary, I think reverting from span/view-style types to an earlier 
> era's C conventions is itself a slippery slope of backsliding to lose the 
> benefits of our rigorous and modern C++ approach to libc implementation 
> internals.

Thank you for the feedback!

I wasn't aware that we consider using any of the libc++ container 
implementations inside llvm-libc, and I think it would be a quite a massive 
undertaking to do so?

In any case, I agree that templatizing our `cpp::string_view` is certainly 
doable, and if that's the direction we want to go (and use the `string_view` 
for handling the wide-characters buffers as we create the implementation of 
more wide-char functions from C standard), let's choose this path instead.

I'm closing this PR and will look into templatizing `cpp::string_view` instead.

https://github.com/llvm/llvm-project/pull/170959
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to