lkimuk / the-book-of-modern-cpp

The Book of Modern C++
Apache License 2.0
739 stars 40 forks source link

P32: 日志与函数名称不匹配 #6

Closed fan-chao closed 1 year ago

fan-chao commented 1 year ago

Hi, 下面这一页(P32)的函数f(A)和f(int)输出的日志感觉不匹配,是不是反了?

企业微信截图_16867285826959

lkimuk commented 1 year ago

Hello,

实参类型为Af(A)是No conversions,属于标准转换,在没有自定义转换operator int()时,f(int)是无法匹配到的。

所以这里无误喔~

fan-chao commented 1 year ago

Hello,

实参类型为Af(A)是No conversions,属于标准转换,在没有自定义转换operator int()时,f(int)是无法匹配到的。

所以这里无误喔~

ok, 那我理解错了。