07/09/01 00:26:15
>>470,471
レス㌧クスです、
自分が見てたのは、こんなのでした
素直に名前を変えます...
struct testFunc {
int n, m;
testFunc(int _n, int _m = 1) { n = _n; m = _m; }
testFunc(int _n, double _m) { n = _n; m = 10; }
operator int() { return n * m * 2; };
operator double() { return n * m * 3.0; };
};
void main() {
int a = testFunc(5);
double b = testFunc(5);
int c = testFunc(5, 5);
double d = testFunc(5, 5);
int e = testFunc(5, 5.0);
double f = testFunc(5, 5.0);
}
もう少し探したらそれらしいのが見つかりました
URLリンク(homepage2.nifty.com)
やりたかったことはこんな感じ↓
URLリンク(anond.hatelabo.jp)