void foo( T... )( T values ) { int[ T.length - 1 ] a; foreach ( i, v; values ) { a[ i ] = [0, 1][i]; } } void main( ) { foo( 1, 2, 3 ); } Prints: testx.d(4): Error: array index 2 is out of bounds a[0 .. 2] testx.d(4): Error: array index 2 is out of bounds [0,1][0 .. 2] testx.d(4): Error: array index 2 is out of bounds a[0 .. 2] testx.d(4): Error: array index 2 is out of bounds [0,1][0 .. 2] testx.d(9): Error: template instance testx.foo!(int,int,int) error instantiating
https://github.com/D-Programming-Language/dmd/pull/187
https://github.com/D-Programming-Language/dmd/commit/60170445584861ec7fd9a93fc2e80863e59dace0 https://github.com/D-Programming-Language/dmd/commit/ca3923f9cb8f8c94e5209e00cab78813b7f363e9
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル