S
selder21
Hello,
I have a class with constructor taking a const string&. Now i want to
call this constructor with a string literal. Because this is of type
char* there are overload resolution conflicts.
If i make another constructor with parameter const char*, how can i
call the constructor with the const string& ?
I tried
Ex::Ex(const string& param){ ... }
Ex::Ex(const char* param){ string temp = string(param); Ex(temp);}
but this gives compile errors.
Greetings, Tom.
I have a class with constructor taking a const string&. Now i want to
call this constructor with a string literal. Because this is of type
char* there are overload resolution conflicts.
If i make another constructor with parameter const char*, how can i
call the constructor with the const string& ?
I tried
Ex::Ex(const string& param){ ... }
Ex::Ex(const char* param){ string temp = string(param); Ex(temp);}
but this gives compile errors.
Greetings, Tom.