More C++ Idioms/Implicit conversions

= Implicit conversions =

Intent
Implicit conversions are performed whenever an expression of some type T1 is used in context that does not accept that type, but accepts some other type T2.

Motivation
In some contexts a variable can be used which is not exactly the type required by the function. In particular: The program is well-formed (compiles) only if there exists one unambiguous implicit conversion sequence from T1 to T2.
 * when the expression is used as the argument when calling a function that is declared with T2 as parameter;
 * when the expression is used as an operand with an operator that expects T2;
 * when initializing a new object of type T2, including return statement in a function returning T2;
 * when the expression is used in a switch statement (T2 is integral type);
 * when the expression is used in an if statement or a loop (T2 is bool).

More info on: C++ Reference en.cppreference.com implicit_conversion

Solution and Sample Code
Conversion of pointer to boolean:

Conversion of std::string to some other type: Example comes from this Stack overflow question titled: C++ implicit conversions.

Known Uses
Everywhere, all the time, ...