Three points: a) Having different string_view types defined in two (or potentially more given the compat suggestion) Boost libraries strikes me as extremely confusing for the users (previous emails have shown it to be confusing for Boost contributors, so it must be even more so for naive users of Boost). It makes sesnse to pick one single design and (ideally though I understand backwards compatibility may be a concern) a single location. b) I personally think that allowing a string_view type to be constructible from std::string_view is eminently sensible and aids usability and interoperability between Boost and non-Boost libraries. People don't like introducing a dependency on std::string_view. That is easily solved by a templated constructor. Note that std::basic_string uses a similar trick (see constructor 9 on https://en.cppreference.com/w/cpp/string/basic_string/basic_string.html), and the StringViewLike type can be constrained in whatever way you are comfortable. (personally I don't have any objection to simply checking '__has_include(<string_view>)' and using it directly but I'm pointing out that if people don't like that there are alternatives) c) People seem to be mixing this up with <format> support. Such a constructor does not impact support for std::format or <fmt> - its presence or absence is entirely orthogonal to whether *::string_view provides std::format support. In fact adding support for std::format to a non-std string_view type is relatively straightforward (if need be I can do a simple demo in godbolt) - you know std::string_view must be available in C++20 (required for std::format) and can therefore create a formatter type that delegates to the formatter for std::string_view. On 04/11/2025 16:54, Ion Gaztañaga via Boost wrote:
El 04/11/2025 a las 17:31, Ruben Perez via Boost escribió:
This is not viable for std::format is it?
I haven't tried std::format yet, TBH. But std::format was not part of the mentioned pull request if I'm not wrong (core::string_view supports it, apparently):
https://github.com/boostorg/utility/pull/51/commits/40614288c8616f430e59d7f5...
Not an expert on std::format to know how we could achieve the same without a hard dependency (if possible).
Best,
Ion _______________________________________________ Boost mailing list -- boost@lists.boost.org To unsubscribe send an email to boost-leave@lists.boost.org https://lists.boost.org/mailman3/lists/boost.lists.boost.org/ Archived at: https://lists.boost.org/archives/list/boost@lists.boost.org/message/IZR5BY7P...