conversion precedence in c++

后端 未结 2 1044
没有蜡笔的小新
没有蜡笔的小新 2020-12-11 08:36

I have the following code:

Some functions:

A::A(int i_a) {cout<<\"int Ctor\\n\";}          //conversion constructor

void h(double d) {cout<<\"d         


        
2条回答
  •  长情又很酷
    2020-12-11 09:11

    Addition from standard(N4687)

    2

    When comparing the basic forms of implicit conversion sequences (as defined in 16.3.3.1)

    — (2.1) a standard conversion sequence (16.3.3.1.1) is a better conversion sequence than a user-defined conversion sequence or an ellipsis conversion sequence, and

    — (2.2) a user-defined conversion sequence (16.3.3.1.2) is a better conversion sequence than an ellipsis conversion sequence (16.3.3.1.3).

提交回复
热议问题