アカウント名:
パスワード:
gcc の方ではネスト関数が使えるのだけど、g++の方にも移植してくんないかな。この機能が無いので古い財産がg++に移植できない。
ちなみにこんな関数ね。
int main(){ int nest(int x) { return x*2; }
printf("%d\n", nest(32));}
int main(){ auto nest = [](int x) { return x *2; }; printf("%d\n", nest(32));}
C++11 を使いたくなければ、int main(){ struct { int operator()(int x) const { return x*2; } } nest; printf("%d\n", nest(32));}
より多くのコメントがこの議論にあるかもしれませんが、JavaScriptが有効ではない環境を使用している場合、クラシックなコメントシステム(D1)に設定を変更する必要があります。
「科学者は100%安全だと保証できないものは動かしてはならない」、科学者「えっ」、プログラマ「えっ」
追加でほしい機能 (スコア:0)
gcc の方ではネスト関数が使えるのだけど、g++の方にも移植してくんないかな。
この機能が無いので古い財産がg++に移植できない。
ちなみにこんな関数ね。
int main(){
int nest(int x) {
return x*2;
}
printf("%d\n", nest(32));
}
Re: (スコア:0)
int main()
{
auto nest = [](int x) { return x *2; };
printf("%d\n", nest(32));
}
Re:追加でほしい機能 (スコア:0)
C++11 を使いたくなければ、
int main()
{
struct {
int operator()(int x) const { return x*2; }
} nest;
printf("%d\n", nest(32));
}