I have a struct :
struct t {
string data;
t(string new_data) { data = new_data; }
string operator +(const char *operand) { return data + string(operand); }
}
when I write
t y="text";
string x = "\r\n" + t;
it (ms visual 2015) says "no operator "+" matches these operands" and the mouse over hint of the "+" source in the editor says "operand types are const char [3] + text" which suggest my overloaded operator should work, doesn't it? What do I have to do so that I can add type t strings to const chars like that?