String, Y U NO append?

Why doesn’t this compile:

beginTest (String ("backend=") << backendName)

where backendName is of type String?

It’s annoying that I have to write

String s;
s << "backend=" << backendName;
beginTest (s);

Am I missing something?

Why not write “StringA + StringB”?

Edit: Is it possible the issue lies with using basic_ostream, and not having a constructor for it?

That worked! Thanks!

I think it’s probably because the unnamed temporary string object is treated as const, but the << operator is non-const.