From [dcl.init]:
Otherwise (that is, for the remaining cases of copy initialization), user-defined conversion sequences that can convert from a source type to a destination type or (when the conversion function) to its derived class are listed as described in 13.3.1.4, and the best of them are selected using overload permissions (13.3).
We can invoke a custom conversion that relates to the source type directly to the target type. That is, if we had Bar(float ) , we would consider this constructor. However, in this case, our candidate is simply Bar(Foo ) , which does not accept float .
You are allowed zero or one custom conversion. In the case of direct initialization, we simply call Bar(Foo ) , which calls one user-defined conversion ( float --> Foo ). In case of initialization of the copy, we look for a sequence of transformations from float (source type) up to Bar (destination type), which includes two user transformations ( float --> Foo , Foo --> Bar ), therefore, an error.
Barry source share