Slide 15
Slide 15 text
{} ʹΑΔॳظԽ
1 void f(const std::vector&);
2
3 ...
4
5 // OK. std::vector は {1, 2, 3} で初期化される
6 f( {1, 2, 3} );
7
8 // コンパイルエラー!
9 fwd( {1, 2, 3} );
foo.cpp:15:5: error: no matching function for call to 'fwd'
fwd({1, 2, 3});
^~~
!
foo.cpp:8:6: note: candidate function not viable: requires 0 arguments, but 1 was provided
void fwd(Args &&... args)
^
1 error generated.