C++相談室 part56 ..
[2ch|▼Menu]
481:469
07/09/01 00:26:15
>>470,471
レスdクスです、
自分が見てたのは、こんなのでした
素直に名前を変えます...

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)



次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5378日前に更新/205 KB
担当:undef