[過去ログ]
C++相談室 part164 (1002レス)
C++相談室 part164 http://mevius.5ch.net/test/read.cgi/tech/1683600652/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
リロード規制
です。10分ほどで解除するので、
他のブラウザ
へ避難してください。
936: デフォルトの名無しさん (ワッチョイ 8e3b-xUKY) [] 2023/10/23(月) 01:32:53.76 ID:sueaiNV30 >>935 https://wandbox.org/permlink/n0KXbXrmLzHDl6KU 次のコードがコンパイルできない struct A { A(int) {} A(const A&) = delete; }; int main() { std::vector<A> v = { 1, 2, 3 }; } http://mevius.5ch.net/test/read.cgi/tech/1683600652/936
938: デフォルトの名無しさん (ワッチョイ 5d01-46Vy) [sage] 2023/10/23(月) 09:29:50.40 ID:9KLj8HWs0 >>936,937 あれ? $ cat test.cpp #include <iostream> using namespace std; struct A { A () {cout << "construct" << endl;} A (const A &p) = delete; A (A &&p) {cout << "move" << endl;} }; void func (initializer_list <A> p) { cout << "func" << endl; } int main () { A a0; A a1; func ({move (a0), move (a1)}); return 0; } $ g++ test.cpp $ ./a.out construct construct move move func http://mevius.5ch.net/test/read.cgi/tech/1683600652/938
940: デフォルトの名無しさん (ワッチョイ 4eda-CTkJ) [sage] 2023/10/23(月) 11:36:11.62 ID:OKLUF2xV0 >>936 コピコン消したいなら代入オペレータ用意してやらんとダメだろ http://mevius.5ch.net/test/read.cgi/tech/1683600652/940
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.039s