C++ 类型转换运算符

yiyunbinlanle 14 0 PDF 2020-12-31 15:12:45

#include using namespace std; class SmallInt { public: /** * implicit constructor * 实现int类型转换为SamllInt类型 */ SmallInt(const int val): value(val) { cout << "SmallInt(const int val)" << endl; } /** * class-type conversion * 无显式返回类型 * 无形参 * 必须定义成类的成员函数 * 一般被定义成co

用户评论
请输入评论内容
评分:
暂无评论