1

Topic: Why on SetValue ("") it was caused SetValue (bool)?

There is not which class variant a variable which has some fitters of values of different types: void setValue (int); void setValue (bool); void setValue (float); void setValue (std:: string); And for some reason on a call setValue ("") it was caused not setValue (std:: string), and setValue (bool). It from what?

2

Re: Why on SetValue ("") it was caused SetValue (bool)?

Hello, Amygdala, you wrote: A> And for some reason on a call setValue ("") it was caused not setValue (std:: string), and setValue (bool). A> It from what? When there is an overload the compiler should solve somehow which method it is necessary to cause. It becomes approximately so: http://en.cppreference.com/w/cpp/langua … resolution the Method with exact coincidence of the signature here misses, therefore the compiler builds chains of implicit conversions which can translate "" in one of arguments (about them look here http://en.cppreference.com/w/cpp/langua … nversion). At once it is clarified that in int and float it cannot be made implicitly in any way, and appropriate functions are thrown out from reviewing. For remained pair possible such implicit ways of conversion: const char () [1] -> const char* -> bool const char () [1] -> const char* -> std:: string Both these conversions are ranged also the second appears strictly worse the first for it needs to address to user-defined to conversion, i.e. To a call of the designer there is nobody the user class string (and it is not important that std:: string). To put it briefly: "and standard conversion sequence is always better than a user-defined conversion sequence".