C++相談室 part56at TECH
C++相談室 part56 - 暇つぶし2ch481:469
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)



次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch