Lisltria / CppPrimerPlusPractice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

类的隐式转换

Lisltria opened this issue · comments

当构造函数只接受一个参数,才能作为转换函数。添加explicit可以关闭自动转换特性。
强制类型转换则是添加函数

operator int ();