Hi,
A suggestion for Arduino project. Make Strings immutable. Meaning that a copy of the String is not made until the string is modified. Many times the scenario is there's one allocation on the stack, for example String str = serial.readString(); and then I make a copy like myObj.str = str; In this case I don't wan't to make a copy of the underlying array (should I use move?). Making strings immutable, like in C#, may be helpful in this scenario. It's probably even possible to implement it without breaking current String interface.. Are there drawbacks to it? I think a common operation that may benefit from mutable strings is something like toLower()/toUpper() because they can be done inplace. Also removing characters can be done inplace. But replace may require a new buffer, concatenation needs a new buffer. So it's a balance of course, but I think makng String immtable and using smart pointer to char* to make readonly copies, may improve memory management since String is such a basic type.
Thanks!