cmake: add option to enable std::string_view#708
Conversation
there was no way to build without STL (more like without iostream), but keeping std::string_view.
|
The fact that you can enable The help text should be adjusted to avoid confusion - this option should almost never be enabled, and I don't want to give users a false impression. Maybe something like "Enable support for std::string_view even if compiler doesn't advertise C++17 or STL usage is disabled". Out of curiosity what's the use case here? |
|
The usecase are freestanding C++ Implementations, this is historically not defined, seems C++26 finally makes an effort: https://cppreference.com/cpp/freestanding In a nutshell, C++ has lot of simple template only stuff that can be used without trouble on systemd without an OS (eg. newlib without board support.) Stuff like accessing IO or mutex locks dont exist, but you could eg. write an custom interrupt-disable lock and use it with The c++ library is also static then. Why I singled out iostreams was, that at a glance Pugixml doesnt seem to use much else, Apart from that, I personally try to avoid iostream, the design always struck me at bad, and there are way better alternatives now: https://en.cppreference.com/cpp/io/print So what I ideally would want:
|
Make the wording tighter as this is a very rarely needed option.
|
Oh I just noticed this is a no-op option. So looks like this PR was not tested? I'm going to revert this. |
there was no way to build without STL (more like without iostream), but keeping std::string_view.
its a bit oddly named (
_HAS_), and IMHO it should be independent whether STL is enabled, but this isthe simplest fix