Better update to say that this happens everywhere I try to use a String() object as an argument to String::format(), not when String::format is used as an argument to another function.
This works:
String::format("frobnicator started at %s", "test");
This does not:
String::format("frobnicator started at %s", String("test"));
I’ve been using it since String::format() was introduced in 0.4.6; also note that the example code in the docs (as presented in my first post) also did compile in that version. Typecasting to (const char*) was never needed prior to this point. Thanks for the workaround though!
This is strange. I thought the docs were updated to include the explicit c_str() call. Nothing has changed regarding String operators. I’ll look into it.
EDIT: I’ve fixed the example code in the docs. To the best of my knowledge, this would never have worked even in 0.4.6, since with a varadic call the compiler does not know the intended target type is. The fix is to add a cast as @ScruffR mentions, or add .c_str() to the string.
Ok so the easy to use example is in fact unusable and that’s why I’m looking to point it out to get the docs fixed and to try and learn how it should be instead. But I think I found it now.