gcc v10.2.0, -std=c++11
I'm not trying to convert the double value to a literal string using 'std::to_string()'. Trying to acheive a similar effect of adding an integer to a string but with a double value instead.
Expected output: "abcdA"
string s { "abcd" };
double d { 65.1 };
// s = s + d; // Error. no match for ‘operator+’ (operand types are ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} and ‘double’)
s += d;
Both the 'operator+' and 'operator+=' methods of 'string' class have a version which accepts a 'char' argument but only the 'operator+=' method seems to receive an implicitly converted value and does not produce an error.
Why does the compiler choose to pass a converted value to one over the other.