File tree 4 files changed +54
-54
lines changed
4 files changed +54
-54
lines changed Original file line number Diff line number Diff line change 1
- int y[5 ][4 ][3 ][2 ];
2
-
3
- int main ()
4
- {
5
- for (int i=0 ; i<5 ; i++)
6
- for (int j=0 ; j<4 ; j++)
7
- for (int k=0 ; k<3 ; k++)
8
- for (int l=0 ; l<2 ; l++)
9
- y[i][j][k][l]=2 ;
10
- }
11
-
1
+ int y[5 ][4 ][3 ][2 ];
2
+
3
+ int main ()
4
+ {
5
+ for (int i=0 ; i<5 ; i++)
6
+ for (int j=0 ; j<4 ; j++)
7
+ for (int k=0 ; k<3 ; k++)
8
+ for (int l=0 ; l<2 ; l++)
9
+ y[i][j][k][l]=2 ;
10
+ }
11
+
Original file line number Diff line number Diff line change 1
- int y[2 ][3 ][4 ][5 ];
2
-
3
- int main ()
4
- {
5
- for (int i=0 ; i<5 ; i++)
6
- for (int j=0 ; j<4 ; j++)
7
- for (int k=0 ; k<3 ; k++)
8
- for (int l=0 ; l<2 ; l++)
9
- y[i][j][k][l]=2 ; // out-of-bounds
10
- }
11
-
1
+ int y[2 ][3 ][4 ][5 ];
2
+
3
+ int main ()
4
+ {
5
+ for (int i=0 ; i<5 ; i++)
6
+ for (int j=0 ; j<4 ; j++)
7
+ for (int k=0 ; k<3 ; k++)
8
+ for (int l=0 ; l<2 ; l++)
9
+ y[i][j][k][l]=2 ; // out-of-bounds
10
+ }
11
+
Original file line number Diff line number Diff line change 1
- // C++11
2
- // decltype is a C++11 feature to get the "declared type" of an expression.
3
- // It is similar to 'typeof' but handles reference types "properly".
4
-
5
- class base {};
6
- class derived : public base {};
7
-
8
- derived d;
9
-
10
- decltype (static_cast <derived *>(&d)) z;
11
-
12
- int main ()
13
- {
14
- }
1
+ // C++11
2
+ // decltype is a C++11 feature to get the "declared type" of an expression.
3
+ // It is similar to 'typeof' but handles reference types "properly".
4
+
5
+ class base {};
6
+ class derived : public base {};
7
+
8
+ derived d;
9
+
10
+ decltype (static_cast <derived *>(&d)) z;
11
+
12
+ int main ()
13
+ {
14
+ }
Original file line number Diff line number Diff line change 1
- // C++11
2
- // decltype is a C++11 feature to get the "declared type" of an expression.
3
- // It is similar to 'typeof' but handles reference types "properly".
4
-
5
- template <class A , class B >
6
- struct whatever {
7
- int f00 (const B b) {
8
- typedef decltype (static_cast <A>(b)) T;
9
- T z;
10
- return 1 ;
11
- }
12
- };
13
-
14
- whatever<int ,float > thing;
15
-
16
- int main ()
17
- {
18
- }
1
+ // C++11
2
+ // decltype is a C++11 feature to get the "declared type" of an expression.
3
+ // It is similar to 'typeof' but handles reference types "properly".
4
+
5
+ template <class A , class B >
6
+ struct whatever {
7
+ int f00 (const B b) {
8
+ typedef decltype (static_cast <A>(b)) T;
9
+ T z;
10
+ return 1 ;
11
+ }
12
+ };
13
+
14
+ whatever<int ,float > thing;
15
+
16
+ int main ()
17
+ {
18
+ }
You can’t perform that action at this time.
0 commit comments