Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 2
    Excuse me, but how much C++ code is embedded code? To be truthful, your domain ditches half of C++ features anyway (forbids their use). So, given how much code you have to write anyway, to replace ditched features of stdlib, you can easily write your own string_view. My vision is: stdlib must target the most common and widespread use-cases. And make the use of it features as comfortable as possible. All other corner cases can be written for specific domain. Ie, that's why stdlib doesn't have BTree or Trie implementation. Commented Jun 22, 2022 at 20:55
  • 1
    @GreenScape not saying I like working with embedded C++. But a lot of embedded code is written in c++, mbed-os, pigweed, arduino, etl. string_view was a welcome addition for developing in embedded c++. I don't think the standard was written with embedded development in mind, but string_view just so happens to work well for embedded development. Commented Sep 8, 2022 at 23:09
  • 3
    The is a surprisingly large amount of embedded C++ code out in wild because it actually often compiles into more efficient code then C. Also there are many features of C++ that are really useful such as templates, constexpr, function overloading, much better type safety, RAII etc.std::string_view increases safety for no additional effort on the developers part, so its really useful in embedded. Commented Sep 15, 2022 at 9:09