In C++, an implicit conversion takes place when passing a type T1 when a type T2 is expected. It can happen in many places like function calls, switch statements, if statements, etc.

Implicit conversion sequence follows this order:

  1. Zero or one standard conversion
  2. Zero or one user-defined conversion
  3. Zero or one standard conversion, only if a user-defined conversion was used.

A user-defined conversion is a non-explicit constructor of type T2 taking a type T1 or T1 has a non-explicit conversion operator to T2. The former is called a converting constructor.

A standard conversion consists of the following, in this order:

  1. zero or one conversion from the following set:
    • lvalue-to-rvalue conversion,
    • array-to-pointer conversion, and
    • function-to-pointer conversion;
  2. zero or one numeric promotion or numeric conversion;
  3. zero or one function pointer conversion; (since C++17)
  4. zero or one qualification conversion.